BackPrevious Page Next PageNext

Exporting to Text

Exporting the report result to a Text file

Exporting the report result to a CSV file

Improving the performance of running a report to delimited format on JReport Server

JReport supports exporting to both a regular Text file and a CSV file.

Exporting the report result to a Text file

To export the result of a report to a Text file, follow the steps below:

  1. Open the report that you want to export.
  2. Click File > Export > To Text. The Export to Text dialog appears.

    Export to Text dialog

  3. Click the Browse button to specify the destination directory and file name of the exported Text file. You can also input the location and file name manually in the Export to text box (make sure that the folder you specify does exist, otherwise an error message will be produced).
  4. If you are exporting a page report, in the Select Report Tabs box, select the report tabs in the page report you want to export. The selected report tabs will be exported in the list order. You can click Move Up button or Move Down button to change the order of the report tabs.
  5. Make sure that the Delimited Format checkbox is unchecked.
  6. Specify whether to use user defined density to export the report result. If yes, specify the horizontal density and vertical density respectively (click here for some notes about setting the density):

    However by exporting using user defined densities, if the densities are not set appropriately, the fields in the report may overlap each other, so you are not recommended to use this way to export the report result to Text.

  7. Check Compress if you want to generate the report result in a compressed size, that is to say there will be no clearance between the columns.
  8. By default, all headers and footers in the report will be exported, including Report Header/Footer, Page Header/Footer and Group Header/Footer. If you only want to export data in the Detail panel, uncheck Header and Footer.
  9. Specify whether to use CR-LF in Windows convention, or LF in Unix convention as the end-of-line character.
  10. Check Run Linked Report if you want to include the reports that is linked with the report (not including the detail reports) in the Text result. If you are only interested in the primary report, leave this option unchecked. Generating linked reports at the same time, especially when the linked reports contain a large amount of data, will cause performance issue.
  11. Click OK to start exporting.

You should pay attention to the following when using the Export to Text feature:

Exporting the report result to a CSV file

When exporting the result of a report to a CSV file, you can set the property Columned on each page report tab or the web report to decide whether to export the result to a general CSV file or a columned CSV file. If you set the property to false, the report will be exported to a general CSV file. If you want to export the report to a columned CSV file, set the property to true.

The following is an example about exporting a page report which contains only one report tab to a general CSV file:

  1. Open the page report.
  2. In the Report Inspector, select the root node that represents the report tab and set the property Columned to false.
  3. Click File > Export > To Text.
  4. In the Export to Text dialog, keep the default export destination.
  5. Check Delimited Format checkbox, and then select CSV Format from the Format drop-down list.
  6. To enable records to be aligned well in the exported file, you are recommended to check Use Quote Mark. Otherwise, the commas in data values such as $78,321.00 will conflict with the delimiter (comma), and may potentially cause the data to be separated incorrectly when the exported file is further processed by other applications. The following shows an example:

    Scarsdale,The Java King,(914) 657-9823,(914) 657-8745,$78,321.00

    As shown above, it is difficult to determine whether the value is $78321.00 or $78 and 321.00.

  7. Check Repeat Last Column Value If Null so that when a cell in the exported CSV result has no value, value of the previous cell in the same column will be used.
  8. Specify the other settings if needed. Here we keep them to the defaults.
  9. Click OK to start exporting.

You should pay attention to the following when exporting a report to a CSV file:

Improving the performance of running a report to delimited format on JReport Server

When exporting a page report to Text, if you want to improve the performance of running the page report to Delimited Format (such as the CSV format) on JReport Server, you are first required to set certain settings in JReport Designer. After which you can then publish the report to JReport Server for running to Delimited Format. See the example below:

  1. Start JReport Designer and open the page report tab you want to run to Delimited Format on JReport Server.
  2. In the Report Inspector, browse to the node of the report tab, find the two properties Fast Pass and Columned, and then set them to true.
  3. Choose the object you want to display in the result file, and then set the location for where you want it to be shown in the result file.

    To do this, select the object, and set its Column Index and Row Index properties in the Report Inspector as required. Column Index refers to the column where the object will be located, and Row Index refers to the row where the object will be located in the result file. The numbers of the column and row start with 1, and are counted within its parent. For example, if you want to place the object in the first column and the second row in the detail section, set Column Index = 1 and Row Index = 2.

  4. Go to the server.properties file in <server_install_root>\bin, and change the property engine.single_thread = false. This enables the property Fast Pass to take effect when running the report tab to Delimited Format.
  5. Publish the page report containing the report tab to JReport Server. When you run or schedule the report, after you choose the report tab and then choose To Text format, select the Delimited Format box, and then click Submit to generate a Delimited Format file.

Notes:

BackPrevious Page Next PageNext