Category: Jaspersoft

An Overview of Jasper Reports Scriptlet Class

Scriplets in Jaspersoft

Scriptlets are sequences of Java code that are executed every time a report event occurs. Values of report variables can be affected through scriptlets. A scriptlet is a java class, which must extend either of the following classes: • net.sf.jasperreports.engine.JRAbstractScriptlet − This class contains a few abstract methods that must be overridden in every implementation. These methods are called automatically by JasperReports at the appropriate moment. The developer must implement all the abstract methods. • net.sf.jasperreports.engine.JRDefaultScriptlet − This class contains default empty implementations of every method in JRAbstractScriptlet. A developer is only required to implement those methods depends upon the needs of their project. The following table lists some of the methods in the above class. These methods will be called by the report engine at the appropriate time, during the report filling phase. Method Description public void beforeReportInit() Called before report initialization public void afterReportInit() Called after report initialization. public void beforePageInit() Called before each page is initialized. public void afterPageInit() Called after each page is initialized. public void beforeColumnInit() Called before each column is initialized. Any number of scriptlets can be specified per report. If no scriptlet is specified for a report, the engine still creates a single […]

Read More +

Jaspersoft Report–Basic Element Properties and Palette

Jaspersoft studio

All elements have a set of common properties. Other properties are specific to the element type. An element’s properties determine its appearance and position on the page. Users can access the properties of a selected element in the Properties view (by default in the upper right area of the UI). In Jaspersoft Studio user place elements within bands (containers). Depending on the elements it contains, the user can change the vertical size of a band. The Palette: Elements appear in the Palette, located by default in the top right of the UI. The palette contains three sub-palettes: Basic Elements: It contains the elements and components available in all editions of Jaspersoft Studio Composite Elements: It contains elements created as combinations of other elements, such as Page Number and Time. Users can add their own composite elements to any palette. Components Pro: contains elements only available in commercial versions of Jaspersoft Studio. This subpalette is not visible in the community edition. DataTerrain with years of experience and reliable experts is ready to assist. We have served more than 200 plus customers in the US and an additional 60 plus customers worldwide. We are flexible in working hours and do not need […]

Read More +

How to create Alternate Row backgroundcolor in Jaspersoft reports

Scriplets in Jaspersoft

Conditional styles combined with some specific report built-in variables can be used to generate alternate row colors in the detail section of Jaspersoft reports. As known, the detail section is repetitive and contains common layout information for records in the dataset. For each record in the dataset, a detail section filling process is called at fill time. Being related to records, one of the most common layouts used for the detail section is the table row layout. And like in any other table, alternate row colors might be needed. To obtain alternate row colors, two things are necessary: 1. To know the current record number in order to determine if it’s odd or even. 2. A conditional style with specific style properties for odd or even rows. The first requirement is accomplished with the help of report built-in counting variables: • REPORT_COUNT – If the row color alternation does not depend on the page, column or group breaks. • PAGE_COUNT – If each new detail page should start with the same row color. • COLUMN_COUNT – If each new detail page column should start with the same row color • <group_name>_COUNT – If each new group of records should start […]

Read More +

Report filling process in Jaspersoft Reports

jaspersoft reports

The main objective of any reporting tool is to produce high-quality documents. Report filling process helps reporting tool to achieve this by manipulating sets of data. The main inputs required for the report-filling process are – • Report Template: Its actual JasperReport file. • Report Parameters : These are basically named values that are passed at the report filling time to the engine. • Data Source: User can fill a Jasper file from a range of data sources like an SQL query, an XML file, a CSV file, an HQL (Hibernate Query Language) query, a collection of Java Beans, etc. The output generated by this process is a .jrprint document which is ready to be viewed, printed, or exported to other formats. The facade class net.sf.jasperreports.engine.JasperFillManager is usually used for filling a report template with data. This class has various fillReportXXX() methods that fill report templates. There are two categories of fillReportXXX() methods in the façade class – • The first type receives a java.sql.Connection object as the third parameter. Most of the times, reports are filled with data from a relational database. This is achieved by – Connect to the database through JDBC. Include an SQL query inside the report […]

Read More +

Why use DataStage?

ETL Datastage

Datastage is an ETL tool which extracts, transform and load data from source to the target. The data sources might include sequential files, indexed files, relational databases, external data sources, archives, enterprise applications, etc. The reasons for using DataStage • DataStage Module helps in reducing the workload and business rules management. It optimizes hardware utilization and control job activities • It provides user interaction with administrative projects. It also keeps interaction with systems and can manage global settings. The administrator’s responsibility varies from setting up projects, properties, adding, deleting and moving projects. A command interface is given to DataStage Repository administrators. • DataStage repository can be viewed and edited, the main interface of DataStage repository is DataStage Manager. To search or Store DataStage repository and manage to reuse Metadata, the Manager loads all the services. It plays an important role in organizing all tasks to the DataStage Repository. • It helps in creating jobs on DataStage or app by giving the design interface. Each job from outside view specifies the instinct of data, possible transformations, and the target as well. The designer will also provide user graphical interface which is easy. The server will take care of loading the executable […]

Read More +

Creating Queries in Jaspersoft Reports

Jaspersoft reports

Jaspersoft Studio provides tools to help user define report fields and create a proper query if a query language is used to acquire the data for the report. These tools are presented in the Dataset and Query dialog. It also provides an easy way to build SQL queries by using a drag-and-drop query builder. This allows users who don’t know SQL or just are not sure about the syntax to quickly join tables and produce complex data filters and where conditions. SQL Builder also provides a way for skilled users to explore the database and list the metadata such as schemas and available tables. Using Dataset and Query Dialog: The dataset and query dialog allows a user to: • Select a data adapter with which to configure the dataset. Usually, a data adapter is selected, but it is possible to change it if necessary. • Select a query language for the dataset being edited (which can be the main dataset or a sub-dataset used to populate a chart or a table). • Specify the query by typing text or by using a tool, if available, designed for the selected language. A tool is available for several languages including SQL, XPath […]

Read More +

Frames in Jaspersoft Reports

Jaspersoft reports

A frame is an element that can contain other elements and optionally draw a border around them. Since a frame is a container of other elements, in the document outline view the frame is represented as a node containing other elements. A frame can contain other frames, and so on recursively. To add an element to a frame, just drag the new element from the palette inside the frame. Alternatively, the user can use the outline view and drag elements from a band into the frame and so on. The position of an element is always relative to the container position. If the container is a band, the element position is relative to the top of the band and to the left margin. If the container is a frame, the element coordinates are relative to the top left corner of the frame. Since an element dragged from a container to another does not change its top/left properties, when moving an element from a container to another its position is recalculated based on the new container location. Advantages of using a frame: • When the user moves a frame, all the elements contained in the frame move. • While using a […]

Read More +