11.7 Customizing the Report in iReport

  1. In iReport, open the new JRXML file that you generated by using the Report Packaging Tool.

    The JRXML file should be located in the IDM/6.1 subdirectory under the directory where when you created the report template.

    Error Messages in iReport When you load a TemplateReport.jrxml file into iReport you may see the following error in the Report Problems window of iReport.

    com.jaspersoft.ireport.designer.errorhandler.ProblemItem@136425a2   java.lang.ClassNotFoundException:com.novell.sentinel.content.reports.TemplateReportScriptlet   com.jaspersoft.ireport.designer.outline.nodes.StylesNode@531d5c7d[Name=,displayName=Styles]
    

    This is not a serious error, so you can simply ignore the message.

  2. After you have opened the report in iReport, you can make the necessary customizations:

    1. Define a SQL query to get the data for your report.

      To provide data for your custom reports, you need to use database views. The core database views that ship with the product include both current state and history information for reporting. In addition to these views, there is a separate set of views that includes only the current state information, thereby providing a slight improvement in reporting performance. For example, the idmrpt_approver_v view provides both current state and history information, whereas the idmrpt_approver_cs_v view provides just the current state information. The structure of the two views is identical, so the columns used are exactly the same. Only the view names are different. The name for each current state view includes _cs before the _v suffix.

      For most applications, you can use the views that provide both current state and history information. These views are described in Section 12.0, Schema Documentation.

      NOTE:You can only use views in custom reports. If you use your root username to log into the database, iReport will let you select data from the tables. However, the report will fail when you deploy it and try to run it.

      To define the SQL query for a report, select the Detail node in the Report Inspector and click the database icon in the designer toolbar at the top of the report definition window. Then, enter the SQL statement on the Report query tab:

    2. Define the report layout.

      To define the report layout, you need to add elements to the report definition. iReport supports many different types of report elements. You can choose the elements you need from the Report Elements section of the Palette.

      For example, to add a column header, drag the Text Field icon from the Palette onto the header band of the report layout canvas.

      To add a data field, drag the field name from the Fields node in the Report Inspector onto the detail band of the report layout canvas.

      When you drag a field onto a report, iReport creates an expression to bind the display element to the appropriate database value.

      Once you’ve added the fields you need, you can format the fields to suit your requirements by stretching them or moving them on the report canvas.

  3. Save your report.

    After saving your report, you need to package the report before you can import or deploy it. For details on packaging the report, see Section 11.9, Building Your Report.