BackPrevious Page Next PageNext

Data Manager

Limiting the query run time and number of records

Viewing a query's running history

Viewing the Designer-side run history information of a query

Viewing the Server-side run history information of a query

The Data Manager in JReport Designer allows you to control the data retrieval of your queries (and also imported SQL files, stored procedures and user defined data sources), including the number of rows to be displayed and the duration allowed for retrieval. It can also keep access information from previous runs of a query.

Limiting the query run time and number of records

There may be many records in a table on which you are to build a report. After you have generated the query and designed the rough report, you may only want to preview several lines of records for testing, in which case, you can take advantage of the two properties - Maximum Rows and Maximum Duration which allow you to limit the run time and number of records, saving time and resources. Taking Payroll Report.cls as an example:

  1. Click File > Open to open the page report Payroll Report.cls in the catalog SampleReports.cat saved in <designer_install_root>\Demo\Reports\SampleReports.
  2. Adjust the Maximum Rows and Maximum Duration properties of the query Payroll on which the report is built to suitable levels. You can adjust the values in either of the following ways:

    Here, modify the value of Maximum Rows to 10 and change the value of Maximum Duration to 1 second. This specifies the maximum elapsed time to be one second, and that within this duration no more than ten records will be fetched.

    Tip: If you find that you are unable to edit the properties, make sure that you have unchecked the Forbid editing data object properties option in the Catalog category of the Options dialog (to display the dialog, click File > Options).

  3. View the report. You will find that only ten rows are fetched within one second.

If your queries use data from a relational database, you can further customize where the two properties will be implemented, on JReport side or on the database side by configuring the file JdbcDriversConfig.properties, which is available in both JReport Designer and JReport Server in its <install_root>\bin directory.

The following is an example of setting the two properties:

DriverName_D2 = Oracle JDBC driver
Vendor_D2 = Oracle
Version_D2 = 9.2.0.3.0 
supportMaxRowPushDown_D2 = true
supportMaxDurPushDown_D2 = true

Notes:

Viewing a query's running history

An important function of the Data Manager is to keep track of the run information of queries. By default, the information is not recorded and shown in the Data Manager to improve performance. If you want to show the history information, you need to first add the command line alwaysShowDMRecord=true in the file report.ini in <install_root>\bin, and then specify the Maximum Duration and Maximum Rows properties of the queries in JReport Designer. Then, the history information will be recorded in a file in <install_root>\dm. In this folder, JReport generates a subfolder for each catalog. For example, if the JReport sample report is run, a folder SampleReports will be created in <install_root>\dm. In addition, a file with a .dmt extension corresponding to the query will be created in the subfolder to store the run history information.

To change the Data Manager information output location (the default is <install_root>\dm), edit report.ini in <install_root>\bin. Change the location in the argument dmPath=C\:\\JReport\\Designer\\dm to the location where you would like the information to go to. For instance, dmPath=C\:\\temp\\dm. Make sure that the folder you specify in the report.ini argument already exists.

Viewing the Designer-side run history information of a query

  1. Open the file report.ini in <designer_install_root>\bin and add the command line alwaysShowDMRecord=true as follows. Here, it is assumed that JReport Designer has been installed to C:\JReport\Designer. The escape character backslash following the = and before each special character such as : and \ are required.
    #paths
    #Wed Jan 04 15:55:43 CST 2017
    dmPath=C\:\\JReport\\Designer\\dm
    helpPath=C\:\\JReport\\Designer\\help
    templatePath=C\:\\JReport\\Designer\\template
    tempPath=C\:\\JReport\\Designer\\temp
    stylePath=C\:\\JReport\\Designer\\style gisinfoPath=C\:\\JReport\\Designer\\gisinfo alwaysShowDMRecord=true
  2. Start JReport Designer and open a report.
  3. Adjust the Maximum Rows and Maximum Duration properties of the query on which the report is built to suitable values.
  4. Click the View tab to view the report.
  5. In the Catalog Manager or the Data panel, right-click the query the report uses and choose Data Manager from the shortcut menu.
  6. The running information of the query is displayed in the Data Manager dialog, which includes when the report is run - date and time, the running duration, the number of rows displayed, and the report that uses the query. You can sort the items by Date, Time, Number of Rows, Duration, Report, simply by clicking the column title.

    Data Manager dialog

The following is an example to demonstrate how to use the Data Manager with the sample report Payroll Report.cls. Here it is assumed that the command line alwaysShowDMRecord=true has been added to the file report.ini in <designer_install_root>\bin and the Forbid editing data object properties option is unchecked in the Options dialog.

  1. Open the page report Payroll Report.cls in the catalog SampleReports.cat. Make sure not to view the report.
  2. Click Home > Catalog Manager.
  3. In the Catalog Manager, expand the Data Source 1 > Queries node, locate the query Payroll then right-click it and select Data Manager. The Data Manager dialog is shown without any history information, since the report has not yet been run.
  4. Close the Data Manager, then specify Maximum Duration as 3 and Maximum Rows as 5 in the Properties sheet of the Catalog Manager for the Payroll query.
  5. Click the View tab to preview the report. After the report result is shown, go to the Data Manager. You can now see the history of this first run of the query.
  6. Use the query Payroll to create another page report report1.cls.
  7. View report1.cls, then the run information will be appended as a record in the Data Manager.

Viewing the Server-side run history information of a query

  1. Open the report.ini file in <server_install_root>\bin and add the command line alwaysShowDMRecord=true to it.
  2. Publish a page report that has its query properties Maximum Rows and/or Maximum Duration set together with its catalog to JReport Server.
  3. Run the report on JReport Server. The Server Engine will save the query run information, but does not have a GUI to display it. In order to view the information, you will need to use the Data Manager in JReport Designer.
  4. Start JReport Designer. Make sure that you have pointed the dmPath argument in the file report.ini in <designer_install_root>\bin to the output location (containing the dm folder) of JReport Server. In most cases you will need to use FTP or remote copy to copy the dm folder from the server machine to the JReport Designer machine.
  5. In JReport Designer, use the Data Manager to view the query's Server-side run history information.

BackPrevious Page Next PageNext