Localizing Page Navigation Links in HTML Report Outputs
When you schedule to publish a report to HTML format, or run it in Advanced mode in HTML format, you can localize the names of page navigation links in the HTML report outputs, such as First, Previous, Next, and Last, according to your requirements.
The localizing process is divided into three steps:
- Create a property file for the desired language.
- Enable the language for the report.
- Apply the localized link names to HTML report outputs.
To localize the page navigation link names in HTML report outputs, a property file must be created first for the desired language. To do this:
- Create the sub directories in
<server_install_root>\resources\report\languages\[language-locale]\properties. For example,
Select here for more information about the naming criterion for language package folders.
- Create a report.properties file in the properties directory.
- Open the property file and copy the following contents to it:
# The following is the report properties file format that can localize the link names in HTML. 4000101=First 4000102=Prev 4000103=Next 4000104=Last 4000105=Back 4000106=Refresh 4000107=@CurrentPageNumber; of @TotalPageNumber;
- Translate the text after = to the language specified by the folder name.
Note: For the line "
4000107=@CurrentPageNumber; of @TotalPageNumber;", you just need to translate "of" to the desired language. In the HTML outputs, @CurrentPageNumber will be replaced by the current page number, and @TotalPageNumber by the report total page number.
- Save the property file with UTF-8 encoding.
- Copy the property file to the
Note: You can just add the <jdk_install_root>\bin directory to your PATH instead of copying the file.
- Convert the contents in the property file into Unicode using native2ascii.exe in
<jdk_install_root>\binby running the following command:
C:\jdk1.7.0_17\bin>native2ascii -encoding utf-8 report.properties > newreport.properties
Note: When you convert your property file to the same directory as the original one, you need to give it a new name instead of replacing the original in order to avoid problems.
- Delete report.properties in
<server_install_root>\resources\report\languages\[language-locale]\propertiesand copy newreport.properties in
<jdk_install_root>\binto it, then rename the property file back to report.properties.
When the property file is ready, the next step is to enable the language defined in the file for the required report.
- Start Logi JReport Server and log onto the Logi JReport Administration page.
- Browse to the row that the report is in, then select the NLS Editor button in the Control column.
- In the NLS Editor dialog, specify a report and catalog version as required.
- Select the button above the Language box, then in the Add Language dialog, choose the specified language and select OK.
- Select OK in the NLS Editor dialog to confirm the settings.
Now the language will have been enabled for the report.
To apply the localized link names to HTML outputs of the specified report, follow the steps below:
- Log onto the Logi JReport Console page and browse to the report.
- Put the mouse pointer over the report row and select the Advanced Run button or Schedule button on the floating toolbar.
- In the Format/General tab of the Advanced Run/Schedule dialog, check Enable NLS and select the specified language from the Using Language drop-down list.
- Specify the other settings and finish the task. Then in the generated HTML outputs, you can see that the page navigation links are displayed in the language you defined for the property file.