Web Reports
In Logi JReport Designer, you can create web reports and publish them to Logi JReport Server for running in Web Report Studio. In Logi JReport Server, end users can create web reports via Web Report Studio (for details, see the Web Report Studio chapter in the Logi JReport Server User's Guide). Web reports created in Web Report Studio can also be downloaded to Logi JReport Designer for editing.
Below is a list of the sections covered in this topic:
Creating a Web Report
The data resources that can be used to create web reports are business views.
To create a web report:
- Open the catalog in which you want to create the report.
- Select Home > New > Web Report or File > New > Web Report.
- A blank web report with a tabular of one cell is displayed. You can then split the tabular and insert components to the tabular cells. For details, see the corresponding topic about the specific component in the Components chapter.
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.
Using Dynamic Resources and Local Parameters in a Web 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.
Creating and using dynamic formulas
To create a dynamic formula:
- In the Data panel of the main window, or in the Resources box of the report wizard, expand the Dynamic Resources > Formulas node, select <New Formula…>.
- In the displayed dialog, specify the name of the formula and select OK.
- In the Formula Editor, create the formula according to your requirement.
- By default, Logi JReport will decide whether the formula can be used as an aggregation object, and if not the formula will be used as a detail object. You can specify to use the formula as a detail, group, or an aggregation object, by selecting the corresponding view element type from the Use As drop-down list on the toolbar.
Whether a dynamic formula can be used as a certain type depends on the following rules:
- Any formula can be used as Detail.
- Any formula that references a DBField and not an aggregation can be used as Group.
- A formula that refers only to aggregations can be used as Aggregation. For example, there are two aggregations Sum_Total and Sum_Quantity, and you can create a formula
@"Sum_Total" / @"Sum_Quantity"
and use it as an aggregation. - A formula that follows the custom aggregation expression can be used as Aggregation.
- Save the formula and exit the Formula Editor.
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:
- You can only use JDK (not JRE) to compile formulas created in Logi JReport and save a dynamic formula with no errors into a web report.
- Currently, global variables are not supported in dynamic formulas.
- When dynamic formulas reference display names or mapping names, the names should not contain any of the following characters if the names are not quoted by double-quotation marks "":
"~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "+", "=", "{", "}", "[", "]", "|", "\\", ":", ";", "\", " ' ", "<", ",", ">", ".", "?", "/"
Examples:
- Expression @Customer#; will cause a syntax error. But @"Customer#" is ok.
- If a field has the display name Category.Aggregation, when adding it to a formula, quote it as "Category.Aggregation" or "Category"."Aggregation".
Creating and using dynamic aggregations
To creating a dynamic aggregation:
- In the Data panel of the main window, or in the Resources box of the report wizard, expand the Dynamic Resources > Aggregations node, then select <New Aggregation…>. The New Aggregation dialog appears.
- In the Aggregation Name text field, specify the name of the dynamic aggregation.
- Select next to the Mapping Name text field to specify the field on which the dynamic aggregation is based.
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.
- From the Aggregate Function drop-down list, specify the aggregate function.
- When done, select OK to create the dynamic aggregation.
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.
Creating and using local parameters
- In the Data panel of the main window, select <New Parameter…> in the Local Parameters node.
- In the New Parameter dialog, create the parameter according to your requirement.
- Select OK to create the parameter and exist the dialog.
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.
Previewing a Web Report
To preview a web report in Logi JReport format, just select the View tab, which then causes Logi JReport Engine to run the web report.
Logi 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, select 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 Logi 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,
- If it contains parameters, you will be prompted to specify values for the parameters in the Enter Parameter Values dialog.
- If it is developed with National Language Support, you can specify the language in which you want the report to display by selecting the language from the Language drop-down menu on the Home or View menu tab.
Notes:
- The function of previewing a web report in Web Report Result also requires that:
- You have checked the option Server for Previewing Reports when installing Logi JReport Designer.
- You have a Logi JReport Live license for your Logi JReport Server.
- The first time when you preview a web report in Web Report Result, the preview server that is included with Logi JReport Designer has to be started so it will be slow. After the first time the preview will be much faster.
- The preview server is a web ad hoc disabled server, and it supports only one user and one report concurrently. Therefore, when you close the report you are previewing, you should use the exit button of Web Report Studio instead of the browser's. In this way, you can release the user session you occupy at the same time, so that you are able to previewing another report later.
- Logi JReport Designer and the preview server are running in two separate JVMs. The preview server applies
-DLogi JReport.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-DLogi JReport.url.encoding=UTF-8
into the startup batch file of Logi JReport Designer as well; otherwise the preview will fail. - When previewing a web report in Web Report Studio,
- Make sure the JDBC driver's class path has been appended to setenv.bat in
<install_root>\server\bin.
- If the report contains some user defined data sources (UDS), you can use the classes you have compiled for using in Designer, but remember to append the classes to the class path of JRServer.bat in
<install_root>\server\bin
.
- Make sure the JDBC driver's class path has been appended to setenv.bat in
Saving a Web Report
To save a web report, select 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:
- Select File > Save As. The Save Report As dialog appears.
- Type a new file name in the Report Name field.
- The web report file type Web Report (*.wls) is the only default value in the Report of Type drop-down list.
- Select Save to save the web report with the new name.
To save a web report to a different catalog, refer to Saving a Page Report to a Different Catalog.
Opening a Web Report
- Select Home> Open or File > Open. The Open Report dialog appears.
- Browse to find the catalog that contains the web report you want to open.
- In the Reports tab, select Web Report (*.wls) from the Report of Type drop-down list.
- All the web reports in the current catalog will be displayed. Select the desired web reports.
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.
- Select Open to open the web reports that you specified.
Tip: If you just want to access some recently open web reports, select File > Open Recent and then select the web reports one by one from the submenu.