cancel
Showing results for 
Search instead for 
Did you mean: 

Adding dynamic data in home page of infoview

Former Member
0 Kudos

Hi All,

I want to add a chart (pic,bar) on the infoview home page (where we find Document list and Personalize). The chart should be dynamic.

For ex: Pie chart should display the active no users v/s total no of users.

     2.   If this is not possible at least i have to display these numbers in the form of text i.e

     no of active users: 100

     total no of users: 500

I could get the query for getting the no of active users.

What page should i modify to get point 1 or 2. Any help is appreciated.

Thanks

Shreyas

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Shreyas

We're looking for an almost identical code that you have mentioned. Clearly you were successful in your attempt. Since we're completely unfamiliar with JSP, could you please share your code for obtaining the current number of users and sessions? Do you also know how we could obtain the number of connections to the server at a given time and the total reports run in a day?

Also, a small clarification - is your code being run in the BO environment or is it a stand-alone Java application?

Thanks a lot

Kriti

Former Member
0 Kudos

Here it is.

Piece of jsp code for getting the count on active sessions and users in the systems.I wrote the below code in home,jsp itself.

// Logon and obtain an Enterprise Session

boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( boUser, boPassword, boCmsName, boAuthType);

  boInfoStore = (IInfoStore) boEnterpriseSession.getService("", "InfoStore");     

  boInfoObjects= (IInfoObjects)boInfoStore.query("SELECT top 6000 SI_ID FROM CI_SYSTEMOBJECTS where SI_KIND='USER'");

boInfoObjects2= (IInfoObjects)boInfoStore.query("SELECT SI_ID FROM CI_SYSTEMOBJECTS WHERE SI_KIND = 'Connection' AND SI_FAILOVER_AVAILABLE_UNTIL = NULL AND SI_AUTHEN_METHOD != 'server-token' ORDER BY SI_NAME");


totaluser=boInfoObjects.size();

sessioncount=boInfoObjects2.size();

This was to get the data for the pie.

To create a full fledge pie chart refer.

https://developers.google.com/chart/interactive/docs/gallery/piechart

Here is snippet of the code for pie chart. Pass the values in totaluser and sessioncount to the pie chart.

var data = new google.visualization.DataTable();

        data.addRows([

          ['No of users', <%=totaluser%>],

          ['Users logged in', <%=sessioncount%>]]);

        // Set chart options

        var options =

  {   'title':'Current user ratio',

  'titleTextStyle':{color: 'black', fontName:'Calibri', fontSize:17},

                           'width':350,

  'height':175,

   'colors':['5c85f4','FF8000'],

   'is3D':'true',

  'fontSize':10,

   'legend':{position: 'right', alignment:'center', textStyle: {color: 'black', fontSize: 10}},

  'chartArea':{left:20,top:30,width:250,height:150},

  'tooltip.text':'both',

  'legend.alignment':'center',

  'backgroundColor':'F7F8E0'

    };

Write a div tag to display the pie chart.

This is it. Whenever a user logs into Infoview, home,jsp runs and the latest values are passed to the pie chart, thereby displaying the dynamic data.

Former Member
0 Kudos

Hi All,

I am new to SDK. Could you please help.

We have BO environment, we would like to have same chart as above.

Could you please explain the detailed steps to get the out put as above.

Former Member
0 Kudos

I was able to write the SQL in a jsp page and directing the output into a text file. Values to the pie chart would be the  values from the textfiles. Thereby making it dynamic

Former Member
0 Kudos

Thanks Amol.

Im using 3.1.

I could find a way to do it using google API, Here it is.https://developers.google.com/chart/interactive/docs/gallery/piechart.


I included the code in home.jsp page.

To make the pi chart dynamic,i can write a PL/SQL code and forward the results to a text file. The text file will have a number which represent the count of users.A piece of Javascript code to extract the contents of the text and store it in a variable. I can use this variable in the code used to generate pie chart.

PL/SQl code has to be executed on a frequent basis to get the latet data.

Thanks
Shreyas

Former Member
0 Kudos

Im yet to write the PL/SQl code.Will let u know when it working fillfledge

Former Member
0 Kudos

Hello Shreyas,

Create your own MyInfoview using BIWorkspace and set that as a home page tab using preferences....

Thnak You,

Amol