Requirement
Sometimes there is requirement to generate a pdf or another format of another report via hyperlink from main report. User expects to get output of another report without running it in UI.
Solution
Users can manage hyperlink on TextField Element in report in Jaspersoft Studio. There is possibility to use REST API features in such hyperlinks.
To achieve this you would need to create a hyperlink on TextField with the following properties:
Link Target - Blank
Link Type - Reference
Hyperlink Reference Expression - value like:
"http://HOST:PORT/jasperserver-pro/rest_v2/reports/public/Samples/Reports/AllAccounts.pdf"
This will generate a pdf export of AllAcounts report from Main Report in JasperReports Server.
If you need to get pdf export of report from another server, not local one, the expression should look like:
"http://HOST:PORT/jasperserver-pro/rest_v2/reports/public/Samples/Reports/AllAccounts.pdf?j_username=userLogin&j_password=userPassword"
References
Get Report Export Via REST API
Jaspersoft Studio User Guide - Hyperlinks
ref case - asymkin 01671629
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now