Product Documentation: Building a Custom Report Tree

A custom representation of the report repository (list of deployed reports) for a given user can be created using a JSP page or servlet. It is assumed that the user has been signed-on into the reporting server with a valid session. To make certain API calls, it is necessary to obtain the repository list for the given user.

demo
Read how InetSoft saves money and resources with deployment flexibility.

JSP Servlet

<HTML>
 <HEAD>
 <TITLE>Replet List</TITLE>
 <% inetsoft.sree.security.SRPrincipal principal = (inetsoft.sree.security.SRPrincipal) 
  session.getAttribute(inetsoft.sree.RepletRepository.PRINCIPAL_COOKIE);
  inetsoft.sree.AnalyticRepository repository =        (inetsoft.sree.AnalyticRepository) 
  inetsoft.sree.SreeEnv.getRepletRepository();
  inetsoft.sree.RepositoryEntry[] entries = repository.getReplets(principal, "r");
 %>
 </HEAD>
 <BODY>
 <% for(int i=0; i<entries.length; i++){
 %> <a href="http://hostname/sree/Reports?
 op=Replet&name=<%=entries[i].getName()%>"
 > 
<%=entries[i].getName()%> 
</a><br> 
<% } %> 
</BODY> 
</HTML>

The resulting code will display a list of reports for which the user and/or his roles have read permissions.

Get/Set Custom User Session Properties

It is often desirable to set certain custom properties for a user session. These properties are external to Style Intelligence, but may be accessed within the Style Intelligence environment. You can also change certain Style Intelligence-specific session properties on the fly.

Although properties can be set through the HttpSession object, it is highly recommended that you access properties using the SRPrincipal object associated with the user session. You can access the SRPrincipal object from within the script of a report as well as from a VPM.

Accessing SRPrincipal in Custom JSP/Servlets

The SRPrincipal object can be accessed from the HttpSession object within a custom JSP or Servlet. You can add or set the properties of the SRPrincipal object using the setProperty() method.

<%@ page import="inetsoft.sree.security.*, inetsoft.sree.RepletRepository" %>
 <%
 SRPrincipal p;
 p = (SRPrincipal) session.getAttribute(RepletRepository.PRINCIPAL_COOKIE);
 if(p == null) {
    p = new SRPrincipal();
 }
   // setting a custom property
 p.setProperty("property_name", "property_value");
   // setting the locale using the locale string
 p.setProperty(SRPrincipal.LOCALE, "en_US");
   session.setAttribute(RepletRepository.PRINCIPAL_COOKIE, p);
 %>

Accessing SRPrincipal in Report & VPM Script

You can access the SRPrincipal object within VPM trigger scripts and report scripts (in the onLoad and onInit handlers, or in element-level script).

var p = parameter['__principal__']; 
// Getting the SRPrincipal properties
p.getProperty(inetsoft.sree.security.SRPrincipal.LOCALE); 

Use Case: Simulating User Sessions

The example presented here will provide administrative users the ability to simulate different user sessions without explicitly logging in as that user.

The administrator would login to the InetSoft server, and access a custom JSP page which sets custom properties on the SRPrincipal object. See Accessing SRPrincipal in Custom JSP/Servlets for more details.

 inetsoft.sree.security.SRPrincipal p =
 (inetsoft.sree.security.SRPrincipal)session.getAttribute
 (inetsoft.sree.RepletRepository.PRINCIPAL_COOKIE);

 // setting a custom property 
 p.setProperty("sim_user", "david");

These custom properties can be accessed within the script of a VPM and used to set a user/role based filtering parameter defined in the 'Conditions' tab of the VPM.

VPM Lookup Trigger:

   var p = parameter['__principal__'];
   if(!isNull(p)) {
    parameter['usr'] = p.getProperty("sim_user"); 
   }

More Articles About Reporting

Call Center Performance Monitoring Solution - So let's take a look at this example of a pre-built call center performance monitoring dashboard. There is a team of users, and it pulls from approximately 70 tables and 3 systems loaded in-memory, call record details, alumni data, and student data. It's loaded and refreshed every night. This can be refreshed however you like, but the point is its pulling these tables from different sources. It can be accessed either by client PC or a mobile device since it's running in a web portal. We have no pre-set hypothesis to answer these questions...

Evaluation of Real Investment for Call Center Reporting - In this case it turned out they did not have to invest in the phones. So you know by doing an evaluation you can see what the real investment should be. You don't want to spend too much money in areas that do not give you the outcomes you are looking for. Let me show you another example. This is from the Department of Health and Human Services. And again the question is where can they get the most bang for their buck, where should they be investing, and really how high should the targets be? Again here what they have found was that trainee and technical guides gave them the most value on the investments. So these are the areas you want to think about...

Field Technician Performance Metrics - Technician Utilization: This indicator tracks how much of a field technician's time is spent on billable vs non-billable duties. Utilizing technicians to their full potential increases productivity and maximizes income. Average Job Duration: The average amount of time technicians spend on each task is determined by this KPI. Organizations may find trends, spend resources wisely, and increase schedule accuracy by analyzing this measure...

Looking at a Call Center Dashboard - Let's look here for a call center dashboard for a moment. These are our call center calls. This is what's coming into our operators. We look at metrics like how many calls were unanswered, what our totals were. What is pretty amazing is when you start looking at these totals, and you think, "oh gosh, these people were answering 5,000 calls a day." And these are typically very short calls. These are ones like "I need a phone number for x, " or "can you connect me with whomever?" You can see here that those are down, too, from this time last year. So everything is a little calmer, a little bit better...

Information About a Dashboard Platform - This is a table of contents of useful product information about, and benefits of, InetSoft's dashboard platform: Business Highlights Dashboard - InetSoft's Style Intelligence offers an easily modified powerful visual analytics dashboard. This enables users to study fluctuations and trends at a glance. You can highlight specific geographic levels in a map based on the data they represent. For example, you can highlight an entire state, or highlight just the cities within the state. In this example, you will highlight in green all the states where the Sum(Quantity Purchased) ranges from 0-1500, and highlight in...

Resource Allocation Analytics - Efficient distribution of resources is a fundamental aspect of emergency management. Dashboards for emergency management integrate many metrics to guarantee optimal resource allocation. Among these analytics are: Resource Demand Forecasting: Based on event severity and past data, predictive analytics may calculate the demand for resources such as staff, medical supplies, and housing. This aids in the authorities' proactive crisis preparation. Resource Utilization Optimization: Emergency managers can maximize the use of resources on the ground by using data analytics. For instance, they may assign medical staff to locations with the greatest caseload by utilizing geographic data...

Previous: Reporting Function as Web Service