Jump to content
We've recently updated our Privacy Statement, available here ×

Dynamically get report path on server


jphayes

Recommended Posts

I need to get the server path a report is run from.

My current process is to create a report under a review folder and publish to the client location.  However, in doing this I have to manually adjust the hyperlink used to access another report for each client I give the report to for the location.  While that does not sound bad in theory it is a pain and leads to issues, especially with the junior report writers.

What I would like to do is get the path it is being run from so I can dynamically setup those hyperlinks and not have to manually adjust each time and avoid causing potential issues.

Development Folder
/organizations/client1/Report_Development/Review/abc/rpttype/Accounting/Accounting_Report_1

Client Folder
/organizations/client1/rpttype/Accounting/Accounting_Report_1

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

We had this same issue where our sub-report path would change depending on what environment the report was executed for.

Our solution was to write a scriptlet that read a configuration file.  We would pass the application to it and in return, it would pass back the full path to the location of the report being executed.

 

Here is an example of our development configuration file:

# Modify the JASPER_SUBREPORT_PATH to identify where
# japer will look for the sub reports
#
#files on server
JASPER_SUBREPORT_PATH=\\\\server\\project\\DEV\\%APP%\\REPORTS\\TEMPLATES\\

 

Here is an example of our sub-report expression:
$P{JasperUtils_SCRIPTLET}.getSubReportPath( "OCR" )+"AAA3-555-001-1295-PDF-SUB01.jasper"

 

The result of that expression using the development configuration previously mentioned would be:
\\server\project\DEV\OCR\REPORTS\TEMPLATES\AAA3-555-001-1295-PDF-SUB01.jasper

 

Link to comment
Share on other sites

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

This requirement seems like an enhancement request.  I'm pleased to let you know about an improved method to make it easier for Jaspersoft users to report enhancement ideas, track the status of those enhancements, and vote for ideas/enhancements that you consider to be most useful. This will be done by using the new Jaspersoft Ideas Portal https://jaspersoftideas.tibco.com/  that was developed by our Product Management team.

This will be a more effective way for you to interface directly with our product team and see the status of your enhancement ideas. Please acknowledge your understanding of using the Jaspersoft Ideas Portal to register this feature request.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...