Creating custom reports

Follow these steps to create custom Jasper reports.

  1. Download Jasper Reports Studio version 6.16.0 or above from the Jaspersoft site and install it.
  2. Launch the Jasper Reports Studio.
  3. Create Data Adapter: Create a data adapter, which will connect to the Control Center database. Ensure you have JDBC Driver and following database details:
    • Database host address
    • Database port
    • Database username, password for the database user
    • Database name.
    Now, follow these steps to proceed:
    1. From Jasper Reports Studio, open the menu File > New > Data Adapter.
    2. When Data Adapter Wizard opens, enter the File Name and click Next.
    3. Select Database JDBC Connection as the source and click Next.
    4. Add the following details and click Finish.
      1. Data Adapter name
      2. Select the appropriate JDBC Driver from the dropdown list: Supported drivers are, Oracle (oracle.jdbc.driver.Oracle Driver), MS SQLServer (2005-2012) (com.microsoft.sqlserver.jdbc.Serverdriver), IBM DB2 (Type 4) (com.ibm.db2.jcc.DB2Driver)
      3. Update the JDBC URL field with Control Center database connection details.
      4. Update the Username field with Control Center database username.
      5. Update the Password field with Control Center database user’s password.
      6. Select the Driver Classpath tab at the bottom of this dialog box.
      7. Click Add to add a database driver.
      8. Browse to the database driver file and select it.
      9. Click Test at the bottom of this dialog box to validate the connection details.
  4. Create Jasper Report: Follow these steps to create a report using report template:
    1. Go to File > Jasper Report.
    2. In the New Report Wizard, you can select an already designed template or select a blank template. For this scenario, select the Blank A4 template and click Next.
    3. Provide the File name for the report (Extension must be .jrxml ) and click Next.
    4. In Data Source step, select the data source that you have created earlier from the Data Adapter dropdown.
    5. Once the data source is selected, the left hand of the dialog will be filled with database objects.
    6. On the right side, enter the SQL query to get the data for the report and click Next. Example,
      SELECT * CC_FILE_TRANSFER
    7. In the Fields step, from the Dataset Fields section, select the fields that will be part of the report and move to the Fields section and click Next.
    8. In the Group by step, if required, from the Dataset Fields section, select the fields to be grouped by and move them to Fields section and click Finish.
  5. Design the template:
    • The report based on the blank template has various band sections:
    • Title: Band to provide the title of the report.
    • Page Header: Band to provide header of each page.
    • Column Header: Band to provide title of each column.
    • Detail 1: Band to provide the actual data which is fetched from the database. You can provide multiple detail bands.
    • Column Footer: Band to provide footer of column.
    • Page Footer: Band to provide footer of each page.
    • Summary: Band to provide summary of report.
    Jaspersoft provides various basic elements which can be used to design any type of reports. Some of the elements are Text Field, Static Field, Image, Line, Rectangle, List, Chart, Table etc. The steps below will guide you on updating the report with title, column headers and data fields:
    1. Add a static text field to the Title band. From the right-hand side palette, drag and drop Static Text into the Title band section. Double click on it to change the text. You can also customize the text more from the right-hand side Properties section.
    2. If needed, add a page header in the Page Header section. Example: Page 1 of 10. This can be achieved by using the Page Number element and Total Pages element.
    3. In the column header section, add static texts for each column for which you want the data to be displayed in the Detail section. Change the text of each static text by double click the added static text field.
    4. To display the data from the database, from the right-hand side palette, drag the Text Field element and place it the appropriate location on the detail band. After placing the Text Field, double click on it and select the appropriate database column that will provide the data for this field. Repeat the process for all the data to be displayed in the Detail section.
    5. If needed, add elements to Column Footer section and Page Footer section.
    6. After customizing the report, click Preview tab at the bottom to view the report output and to test it.
    7. If needed, click on the Design tab to modify the report.
    8. Once all the customization is done, Save this report.
  6. Run custom report from IBM Sterling Control Center: Custom reports created using Jasper Report Studio can be used within Control Center. Before the report can be used, the report definition file that ends with .jrxml must be copied to Control Center configuration folder. To do so, follow these steps:
    1. Locate the definition file of the Jasper Report that you have created in the file system ending with with .jrxml. Example: It could be located under C:\Users\<<UserID>>\JaspersoftWorkspace\MyReports folder.
    2. Copy the reports definition file to <<CCInstalledLocation>>conf\reports\custom folder. This file must be copied to all the instances of Control Center in a clustered environment.
    3. Restart the Classic Console.
    4. Go to Tools > Reports > Define / Run.
    5. Click Create from the Reports Listing panel,.
    6. Select Custom as the Report Category to find your custom report.
    7. Select the report to run and click Next.
    8. Select the report output format and click Next.
    9. Click Run Report.
    10. After the report output is displayed, you can save the report.