Report Programming - Initialization Parameters

Initialization parameters are purely deployment-time parameters. They can only be specified in the configuration file (repository XML file). The parameters are similar to the configured creation parameters both in the types of parameters supported and their internal format in the XML file. The major difference between an initialization parameter and a creation parameter is how they are passed to a replet.

Passing Initialization Parameters

All initialization parameters are packaged into a RepletRequest object, with a request name of RepletRequest.INIT. The RepletRequest object is passed to the init() method of the replet. Since init() method is only called once after a replet is created, the request object is only seen by the replet once during its life cycle. The initialization is done before a replet is called to create a report object, so the values of initialization parameters can control how a report is created.

In many situations, an initialization parameter can be replaced by a configured creation parameter. However, if a replet needs an initialization parameter to configure its internal states, in addition to prompting user input, an initialization parameter has to be used. If the creation parameter is used in the configuration file to control the initialization of the replet, end users will never be prompted for the actual creation parameters.

Conceptually, initialization parameters are for relatively static configuration information and creation parameters are for dynamic reporting parameters. The fact that initialization parameters are only passed to the replet once, while creation parameters are passed to the createReport() method on every invocation, underlines the inherent differences of their intended usage.

#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

Example: Initialization Parameters

To illustrate the use of initialization parameters, we modify our last example to take an initialization parameter called 'templateName'. The parameter specifies the report template file to be used to create the actual report (in this example, 'embeddedtable2.srt'). We will create a new replet class called 'Replet3' to read in the initialization parameter and load the template file based on the parameter value.

Initialization Parameters

public void init(RepletRequest req) throws
RepletException {
try {
// load the report template
InputStream input = getClass().
getResourceAsStream("/" + req.getParameter("templateName") + ".srt");
 
Builder builder = Builder.getBuilder(Builder.TEMPLATE,
input);
report = (ReportSheet) builder.read(".");
// load data from data file
InputStream input2 =
getClass().getResourceAsStream("/data/education.csv");
 
ttl = new TextTableLens(input2,",");
ttl.setHeaderRowCount(1);
 
RepletParameters def = new
RepletParameters(RepletRequest.CREATE);
def.addParameter("Title", "", null);
addRepletParameters(def);
 
} catch(Exception e) {
e.printStackTrace();
throw new RepletException(e.getMessage());
}
}

Notice that we only changed one line of code in this replet. In addition, since initialization parameters are configuration parameters only, they need not be declared like the creation parameters. After we compile this file, we use the Enterprise Manager to add a new replet to the repository.

On the Replet Definition registration screen, enter '/Replet3' for 'Name', select 'Class' for 'Type', enter 'inetsoft.demo.replets.Replet3' for 'Class or Template'.

Click the 'New' button under 'Initialization Parameters'. In the Parameter registration screen, select 'String', enter 'templateName' as the 'Parameter Name', enter 'embeddedtable2' as the 'Parameter Value' and click 'OK'. This parameter will be added as an initialization parameter to the replet definition. We then save the 'Replet Definition'.

After the replet is registered, you can view the replet with the web viewer.

If we later want to change the report template for this replet, the only thing we need to do is to change the initialization parameter in the repository. The replet does not need to be modified or recompiled.

The sortOnHeader initialization parameter

A commonly used initialization parameter is 'sortOnHeader', which enables table sorting when a header cell is selected. This Boolean type parameter can be set in the Enterprise Manager or by creating an initialization parameter through the API.

Setting 'sortOnHeader' parameter through the API

public void init(RepletRequest req) throws RepletException {
RepletRequest rr = new RepletRequest(RepletRequest.INIT);
rr.setParameter("sortOnHeader", new Boolean(true));
…
}

More Articles About Reporting

Challenge of Changing Business Needs for BI - The challenge of this kind of business intelligence strategy was it was very hard to maintain and adapt to changing business needs. Many resources went into just managing this complex BI infrastructure. So organizations are now moving towards standardization of BI platforms and looking for a platform not just for the business intelligence needs but also to integrate it with business processes capabilities integrated with applications from multiple vendors and technologies such as search. That kind of standardization on one BI platform, it definitely helps to drive efficiency. The other area is to have service level agreements with the business, an information foundation where information is extracted via service oriented Web services, enterprise services, with guaranteed service level agreements such as response times. That is an area that we have been heavily investing in together with business partners to leverage in-memory technology to deliver rapid response time independent of any type of query or business request. It certainly helps with agility...

Information Consumers And Power Users - And by the way, there are more than just two constituencies here. I think we are going to break down information consumers and power users into more granular categories, but just for simplification sake, as a bare minimum, identifying these two very distinct categories is key. One is an information consumer who just wants to look at reports and dashboards that have been built for them, and the other is a power user who wants to not only consume but create new analytical views on their own. The difference between information consumers and power users lies primarily in their interaction with data, their level of technical expertise, and their roles within an organization, particularly in the context of data analytics, business intelligence (BI), or software tools. 1. Information Consumers Purpose: Information consumers typically use data for basic decision-making or for gaining insights that directly apply to their daily roles. They often rely on pre-made reports or dashboards created by others, and their primary need is to interpret or consume the information, not manipulate or generate new data sets...

Machine Learning vs. Data Mining - I think there is a difference between machine learning and data mining. Machine learning is similar to data mining because a lot of the pioneers in data mining are still around, and they are pioneers in machine learning. In my mind part of the main difference was the emphasis even in the terms. One emphasizes mining. The other one emphasizes learning in terms of the branding. I think that's one of my observations. The other thing of course is the notion that we have to separate empirical results versus theory. So people in industry I guess they care about theory to some extent, but at the end of the day it's empirical results that matter. I think the connotations data mining sometimes brings up, and if that's historical consequence I don't know, is that, it's about torturing data. It's about mining it till it confesses with whatever the preconceived notions you had going into it. I think maybe that's a little bit unfortunate. Indeed I think that's probably more where we want to be than in that drill-till-you-find-something mentality...

Ocean Ranching Reporting Software - OceanRanch Aquaculture, a leading ocean ranching company, specializes in sustainable fish farming practices off the coast of California. With an emphasis on environmental stewardship and efficiency, the company faced challenges in managing and analyzing vast amounts of operational data. To improve transparency, optimize resource management, and enhance decision-making processes, OceanRanch implemented a sophisticated reporting software solution. This case study explores the steps taken during implementation, the features of the reporting software, and the transformative impact on the company's operations. Background OceanRanch Aquaculture's primary operations include the cultivation of fish in controlled ocean environments, monitoring fish health, tracking feed usage, and ensuring compliance with environmental regulations. The company's data sources were diverse, including: Operational Data: Daily logs of fish growth rates, feed consumption, and water quality metrics...

Why Use a Word Cloud Chart? - A Word Cloud is an attention-grabbing chart type that very rapidly conveys which terms have the greatest frequency in the document or text source, which are often among the most important terms. However, as a data analysis tool, the Word Cloud has severe limitations. Two particular shortcomings are that it is very difficult to accurately judge the relative value of a measure by using font sizes or font weights, and, secondly, that certain words are simply larger than others, not owing at all to their importance in the document. For example, the term "independent" will generally appear larger than the term "law" even if the term "law" appears with equal or higher frequency in the document. Word Clouds should therefore be restricted to use only as a presentation aid, and not in any way as an analytical tool. Other chart types such as bar and point charts are far more effective for analysis purposes. How to Make a Word Cloud Chart in InetSoft Creating a Word Cloud with InetSoft software is extremely simple. A preliminary step is to transform a document or other word source into a table that contains the words and their relative frequencies, such as shown below...

Using Snowflake as the Data Platform to Feed a Dashboard Solution - Using Snowflake as the data platform to feed a dashboard solution offers several advantages, making it a popular choice for organizations looking to build scalable, high-performance analytics solutions. Here are some of the key advantages of using Snowflake: Scalability: Snowflake is built on a cloud-native architecture designed for scalability. It can seamlessly scale up or down based on workload demands, allowing organizations to handle large volumes of data and accommodate growing user needs without significant infrastructure investments or performance degradation. Performance: Snowflake leverages innovative technologies such as multi-cluster architecture, automatic scaling, and query optimization to deliver high-performance analytics processing. It supports parallel processing of queries, enabling fast query execution times and real-time data insights for dashboard visualization. Concurrency: Snowflake provides built-in support for concurrent data access, allowing multiple users to query and analyze data simultaneously without impacting performance. This concurrency model is essential for interactive dashboard solutions that require real-time access to data by multiple users...

Strong KPI Dashboard - Quality is preferred than quantity for dashboard reporting that is effective. You only have one screen to use as a canvas when using a dashboard. Anyone looking at the screen ought to be able to take in the important information swiftly and without difficulty. Overcrowding your dashboard with useless gauges or graphs muddles the message and might make it difficult to determine what is most important. Prioritize the appropriate KPIs for your dashboard report. Pick the ones that most effectively represent the tale of your data, to be more precise. What KPIs are most important to your bottom line? What would the recipient of the report like to see...

Previous: Example of a Parameterized Report
We will help you get started Contact us