JHyperlink can be used to create hyperlinks in reports. This section shows you two specific examples about using JHyperlink:
Sometimes you have built a number of reports and each of them contains different information about the same subject. You may want to build a summary report to organize these reports together. For example, Report A is Summary Information of City Wise, while Report B is an Account List of City Wise. When you click on the city in Report A, it should go to the page of that city in Report B. With this hyperlink feature, you can build hyperlinks among reports. In addition, you can also insert any hyperlink to be invoked. In any case, a web browser will be displayed to view the specified pages.
http://localhost:8888 in the value cell of the URL property as the JReport Enterprise Server address, make sure the Executer Class Name value is jet.udos.IEExecuter, and then type JReport Enterprise Server in the Display Value property value cell as the display name of the hyperlink. See illustration.
http://www.jinfonet.comTwo hyperlinks have been successfully built into the report.
Notes: After you insert a JHyperlink into a report which is to be exported to PDF, Excel or HTML, you can specify whether to make the hyperlink effective by setting a property which corresponds to the format type. Respectively, they are: Enable Hyperlink in PDF for PDF, Enable Hyperlink in Excel for Excel and Enable Hyperlink in HTML for HTML.
JHyperlink can be used to link reports as master and detail reports to show related information in a hierarchy, such as Orders and Line Items. You can use the JHyperlink object to control the URL to show the information in the detail reports on JReport Enterprise Server. For how to use JHyperlink to link reports as master/detail reports, JReport Designer provides an example for your better understanding.
All the needed materials for this example, including the report sets and catalog are compressed in the file JHyperlink_Master-detail.zip in <install_root>\help\designer\samples. Extract JHyperlink_Master-detail.zip to <install_root>\help\UDODemo, and do the following steps:
jdbc:hsqldb:<install_root>\help\UDODemo\db\demo.Linking the master report to the detail report
Formulas will be used to control the property values URL and Display Value of JHyperlink to make it link the master and detail reports.
A JHyperlink is inserted in the Detail panel of the report. The URL and Display Value property values of the UDO are as follows:
|
This URL value enables you to drill down to the detail report and also make a link for this detail report on the top of the page for you to drill up and down.
In the GroupHeader panel, the value of Total is a JHyperlink, whose property values URL and Display Value are both controlled by formulas.
|
Where, the URL is used to access the detail report SalesYearPerformancebyQuarter.cls, and the records of the detail report are filtered by the parameters pEmployeeID and pYear.
"$"+ToText(@Sum_TotalSales0)
This formula returns the total sales amount for the year.
Running the master/detail reports on JReport Enterprise Server
This example requires you to access the report by URL, you can drill the reports up and down. To do this:
Note: When using JHyperLink to link a report and a parameter with special characters such as "\" and "&" is used in the URL, you need to add "\" before the special character.
For example:
If Parameter=a&b, make it: Parameter=a\&b
If Parameter=a\b, make it: Parameter=a\\b