Using dynamic resources and local parameters in a web report
In JReport Designer, you can create web reports and publish them to JReport Server for running in Web Report Studio. In JReport Server, end users can create web reports via Web Report Studio (for details, see the Web Report Studio chapter in the JReport Server User's Guide). Web reports created in Web Report Studio can also be downloaded to JReport Designer for editing.
The data resources that can be used to create web reports are business views.
To create a web report:
When a web report is created, you can also further modify it the same as you do with a page report. For details, see Editing a Page Report.
When working with a web report, sometimes you may find the predefined view elements in the business view the web report uses, or the predefined parameters in the current catalog cannot meet your requirements. In this case, you can create dynamic resources (including formulas and aggregations) and local parameters and use them in the web report to get the desired data. Then when you save the web report, the dynamic resources and local parameters will be saved along with it as its resources in the .wls file. Unless you need to use a formula, aggregation or parameter in multiple web reports, it is always better to create dynamic resources and local parameters rather than catalog ones.
Dynamic resources and local parameters are web report level resources, which means they are only available to the web report for which they are created.
To create a dynamic formula:
Whether a dynamic formula can be used as a certain type depends on the following rules:
@"Sum_Total" / @"Sum_Quantity"
and use it as an aggregation. Once a dynamic formula is created, you can then drag it from the Data panel to the desired position in the report, or add it as report field when working with the report wizard.
In the Data panel, you can make use of the shortcut menu of any existing dynamic formula to edit or delete the formula, or change the formula type as Group, Detail, or Aggregation if needed. Dynamic formulas that have been used in the web report cannot be deleted.
Notes:
"~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\", " ' ", "<", ",", ">", ".", "?", "/"
Examples:
To creating a dynamic aggregation:
You can map dynamic aggregations to the available resources such as group objects and detail objects in the current business view, or the dynamic formulas that have been created in a web report.
Once a dynamic aggregation is created, you can then drag it from the Data panel to the desired position in the report, or add it as report field when working with the report wizard.
In the Data panel, you can make use of the shortcut menu of any existing dynamic aggregation to edit it in the Edit Aggregation dialog or delete it. Dynamic aggregations that have been used in the web report cannot be deleted.
Once a local parameter is created, you can then use it to dynamically filter data of a data component in the web report, add it to a parameter control or parameter form control in the web report when it is used in the web report, or reference it in a dynamic record level pass one formula used in the web report.
In the Data panel, you can also make use of the shortcut menu of any existing local parameter to edit or delete it. Local parameters that have been used in the web report cannot be deleted.
To preview a web report in JReport format, just click the View tab, which then causes the JReport Engine to run the web report.
JReport also allows you to preview your web report in the following formats: Web Report Result, HTML, PDF, Excel, Text, RTF, XML and PostScript. To do this, click View > Preview As and select a format from the drop-down menu. If Web Report Result is selected, the web report will be opened in Web Report Studio. When any of the other formats is selected, the report will be exported to a temporary file which will automatically be opened in the format with the appropriate application. The temporary file will be removed when you exit JReport Designer. If you want the file to be saved so that you can review it at any time, use the Export feature instead.
When previewing a web report,
Notes:
-Djreport.url.encoding=UTF-8
in the startup batch file and this setting covers URL encoding/decoding. Therefore, when you preview a web report in Web Report Studio, if the name of the report or catalog file contains non-Latin characters, you need to add -Djreport.url.encoding=UTF-8
into the startup batch file of JReport Designer as well; otherwise the preview will fail.<install_root>\server\bin.
<install_root>\server\bin
.To save a web report, click Home > Save or File > Save. This operation can also be accomplished by pressing the Ctrl + S keys. If the web report to be saved is new, the Save Report As dialog will appear for you to input a name.
To save a web report with a different name in the current directory:
To save a web report to a different catalog, refer to Saving a Page Report to a Different Catalog.
If you want to open web reports that you have opened recently, switch to the Recent tab, and then select the web reports you want to open.
Tip: If you just want to access some recently open web reports, click File > Open Recent and then select the web reports one by one from the submenu.