### 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 `<in` `stall_root>\bin`. 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.

This section shows how to view the history information of a query running both on JReport Designer and JReport Enterprise Server.

#### Viewing the designer-side run history information of a query

To view the designer-side run history information of a query, follow the steps below:

1. Open the file report.ini in `<designer_install_root>\bin` and add the command line `alwaysShowDMRecord=true` as below. Here, it is assumed that JReport Designer has been installed to `C:\JReport\Designer`.

       #paths
       #Thu Apr 19 13:57:30 GMT+08:00 2007
       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
       alwaysShowDMRecord=true

2. Open a report and adjust the Maximum Rows and Maximum Duration properties of the query on which the report is built to suitable values (click here for details about how to set the property values).
3. Click the View tab to view the report.
4. In the Resource View panel (or the Catalog Browser panel), right-click the query the report uses and choose Data Manager from the shortcut menu. You will now find that the run information of the query is displayed in the Data Manager dialog.

Notes:

- When the values Maximum Duration and Maximum Rows are 0, the history record will not be generated.
- In the Data Manager, you can also sort the items by Date, Time, #Rows, Duration, Report, simply by clicking the column title.
- The Data Manager allows you to find details of current and previous runs of a query.

The following is an example to demonstrate how to use the Data Manager with the sample report InvoiceReport.cls. Here assumed that the command line `alwaysShowDMRecord=true` has been added to the file report.ini in `<in` `stall_root>\bin`:

1. Click File > Open on the menu bar.
2. In the Open Report Set dialog, click the Browse button to open the catalog file SampleReports.cat in `<designer_install_root>\Demo\Reports\SampleReports`, then open the sample report InvoiceReport.cls but do not view it.
3. Click View > Catalog Browser.
4. In the Catalog Browser, right-click the query Invoice and select Data Manager. The Data Manager dialog is shown without any history information, since the report has not yet been run.
5. Close the Data Manager, then specify Maximum Rows as 5 and Maximum Duration as 3 in the Catalog Browser for the Invoice query.
6. Click the View tab to run the report. After the report result is shown, go to the Data Manager. You will now see the history of this first run of the query.

   The history information will include when the report is run - date and time, the running duration, the number of rows displayed, and the report that uses the query.

7. Close the report, and use the query Invoice to create another report report1.cls.
8. Run report1.cls, then the run information will be appended as a record in the Data Manager, but the Report field it shows will be report1.

#### Viewing the server-side run history information of a query

To view the server-side run history information of a query, follow the steps below:

1. Open the report.ini file in `<server_install_root>\bin` and add the command line `alwaysShowDMRecord=true` as below. Here, it is assumed that JReport Enterprise Server has been installed to `C:\JReport\Server`.

       #paths
       #Thu Apr 19 11:25:31 GMT+08:00 2007
       dmPath=C\:\\JReport\\Server\\dm
       helpPath=C\:\\JReport\\Server\\help
       templatePath=C\:\\JReport\\Server\\template
       tempPath=C\:\\JReport\\Server\\temp
       stylePath=C\:\\JReport\\Server\\style
       alwaysShowDMRecord=true

2. Publish a report that has had its query properties Maximum Rows and/or Maximum Duration set in JReport Designer to JReport Enterprise Server (for details, see Publishing resources remotely).
3. Run the report on JReport Enterprise 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. Open the report on JReport Enterprise Server and 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 the server. Then in JReport Designer, open the corresponding query in the Catalog Browser to show its server-side run history information.