How to reference a Content Resource in a hyperlink

0

I uploaded a PDF document to the JasperReports Server as a Content Resource.  When I browse the repository, I can view it just fine.  Now what I want to do is add a hyperlink in a report that opens up the PDF file in another window.  The URL that is generated when I click on the document looks like this:

https://MYSERVER/jasperserver-pro/fileview/fileview/organizations/10203/Productivity_Reporting/Reports/Productivity_User_Guide?

I tried to create a hyperlink with a type of Reference and used the URL above.  However, when I run my report and click on the link, I get a generic error "Internal server error occurred. Please contact your system administrator." There is no error number or details.  I also tried to use the ReportExecution hyperlink type but it generates an invalid uri message.  

How should content resources be referenced in a hyperlink?

 

jasonp_1's picture
Joined: Mar 6 2013 - 12:18pm
Last seen: 7 years 3 weeks ago

1 Answer:

0

possibly the extension ".pdf" is missing?

i tried and works fine for me...

Cheers, Thomas

http://www.thomaszimmer.net

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 1 day 17 hours ago

I think the ".PDF" would only be required if the resource ID contained it, which is the default behavior, but I removed it from the ID. I'm thinking the issue is related to the fact that I am running in multi-tenancy mode, which is why my path includes the "organizations/...", so I may have the path wrong. There is very little information on how the paths change when running multi-tenancy.

jasonp_1 - 7 years 2 months ago

After "organizations/..." you have to put the unique id of your organization, then the path. Like this:
.../fileview/fileview/organizations/Organization_2/Reports/Samples/Employees.pdf?
And you were absolutely right about the file extension, it is not needed.
Greetz

Thomas Zimmer - 7 years 2 months ago
Feedback
randomness