The Data Manager in Logi 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.
Below is a list of the sections covered in this topic:
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 InvoiceReport.cls as an example:
- Open the page report InvoiceReport.cls in the catalog SampleReports.cat saved in
- Adjust the Maximum Rows and Maximum Duration properties of the query Invoice on which the report is built to suitable levels. You can adjust the values in either of the following ways:
- In the Catalog Manager, right-click the query and select Properties from the shortcut menu. In the Properties sheet, change the property values as required, then press Enter on your keyboard to apply the change.
- In the Data panel, right-click the query and select Properties on the shortcut menu. In the Properties dialog, edit the property values as required and then press Enter to confirm.
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, select File > Options).
- View the report. You will find that only ten rows are fetched within one second.
- You can decide where the two properties will be applied, on Logi JReport side or on the database side, by configuring the JdbcDriversConfig.properties file. For details, see Specifying where to implement the maximum query run time and number of records.
- If the value of the Maximum Rows/Maximum Duration property is 0 or a negative number, it means the number will be unlimited.
- If the number you specify for Maximum Rows/Maximum Duration is equal to or more than that required for running all the records in your report then you will retrieve all of the records.
- It is not recommended to specify both of the properties at the same time. Sometimes the time information for large-data reports may not be very accurate. For example, if you specify 5 seconds, you may find that it takes 7 seconds, since this time also includes the time for writing the history information to a file.
- Select the Refetch Data button on the toolbar of the View tab to run the report again if you find that the specified properties have not taken effect.
- These two properties apply to the specified query, not the report. For a report with a subreport, specifying the properties for a query used by the primary report will not have any effect on the subreport's query, and vice versa. For example, Report A.cls uses query Q1, and Report B.cls uses query Q2. B.cls is inserted to A.cls as a subreport. Maximum Rows for Q1 is modified to 3. The primary report will now only fetch three records, whereas Q2 for subreport B.cls will not be affected. To limit the subreport records, you will have to restrict Q2.
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
stall_root>\bin, and then specify the Maximum Duration and Maximum Rows properties of the queries in Logi JReport Designer. Then, the history information will be recorded in a file in
<install_root>\dm. In this folder, Logi JReport generates a subfolder for each catalog. For example, if the Logi 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\:\\Logi 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
- Open the file report.ini in
<designer_install_root>\binand add the command line
alwaysShowDMRecord=trueas follows. Here, it is assumed that Logi JReport Designer has been installed to
C:\Logi JReport\Designer. The escape character backslash following the = and before each special character such as : and \ are required.
#Wed Jan 04 15:55:43 CST 2017
stylePath=C\:\\Logi JReport\\Designer\\style gisinfoPath=C\:\\Logi JReport\\Designer\\gisinfo alwaysShowDMRecord=true
- Start Logi JReport Designer and open a report.
- Adjust the Maximum Rows and Maximum Duration properties of the query on which the report is built to suitable values.
- Select the View tab to view the report.
- In the Catalog Manager or the Data panel, right-click the query the report uses and choose Data Manager from the shortcut menu.
- 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 selecting the column title.
The following is an example to demonstrate how to use the Data Manager with the sample report InvoiceReport.cls. Here it is assumed that the command line
alwaysShowDMRecord=true has been added to the file report.ini in
stall_root>\bin and the Forbid editing data object properties option is unchecked in the Options dialog.
- Open the page report InvoiceReport.cls in the catalog SampleReports.cat. Make sure not to view the report.
- Select View > Catalog Manager.
- In the Catalog Manager, expand the Data Source 1 > Queries node, locate the query Invoice 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.
- 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 Invoice query.
- Select 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.
- Use the query Invoice to create another page report report1.cls.
- 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
- Open the report.ini file in
<server_install_root>\binand add the command line
- Publish a page report that has its query properties Maximum Rows and/or Maximum Duration set together with its catalog to Logi JReport Server.
- Run the report on Logi 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 Logi JReport Designer.
- Start Logi JReport Designer. Make sure that you have pointed the dmPath argument in the file report.ini in
<designer_install_root>\binto the output location (containing the dm folder) of Logi 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 Logi JReport Designer machine.
- In Logi JReport Designer, use the Data Manager to view the query's Server-side run history information.