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

passing url parameters and returning a pdf


manshack_one
Go to solution Solved by manshack_one,

Recommended Posts

I have some reports set up right now that are ran from a url link in the application.  The username and password is hardcoded into the url and everything works fine.  They are displayed a new window, they enter the 2 dates the report has parameters for and they get the report.  At that point they can hit the pdf icon and print it out or save it.

What I was hoping to be able to do is to pass those date parameters in the url.  Can you do that?

The next thing I'd love to be able to do is just pass the parameters and have a pdf file displayed instead of opening the jasper server window and exposing the jasper server website to them.  I know you can do it by putting the report compilation into a java application and calling it with  the parameters.  I was just hoping there was an alternative in jasperserver to pass in the parameters (which would be gathered and formed using a funciton in the application where the url would be built) and just get the pdf back.  Can that be done?

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

I always seem to answer my own questions.  :)

You have to turn off "Always Prompt" in the input control or else the URL method will always display the input control screen in Jasperserver.  Here's my url:

http://192.168.200.51:8081/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/HEALTH/HCD-HTN&standAlone=true&ParentFolderUri=/reports/HEALTH&j_username=HCD&j_password=health&output=pdf&begindate=20091014000000&enddate=20091031000000

Aside from turning off that option you have to format your date like a timestamp.  I'm using mysql so adding 6 0's at the end worked fine.  The link will now directly bring back the pdf without the user seeing the jasper server screen.

Link to comment
Share on other sites

  • 4 years later...
  • 3 months later...
  • 4 years later...

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...