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

Parameter Passing in URL!


hussainian

Recommended Posts

Hi!

I put the following url in the address bar

http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/samples/AnnDetail&standAlone=flase&ParentFolderUri=/reports&j_username=jasperadmin&j_password=jasperadmin

and go to the page where JasperServer asks me to input the values of parameters. I enter the values and my report is displayed with this url

http://localhost:8080/jasperserver/flow.html

Is there any way that I can embedd the values of the parameters in the url and instead of parameters page, the jasperServer takes me directly to the report? While doing this, one thing should be in consideration that the parameters are of date type and the report will only accept date type values.

The thing I want to do is that in my own application's page, I'll enter the parameters and submit. At this submit, the first url will go. How to add parameters to that url?

Thanks & Best Regards.

AsadUllah.

Please help.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Its very easy. In JasperServer, create input controls with the names exactly as are the report parameters. And then add the parameter and their values in the url just as user name and password.

For example, for a Parameter in the Jasper Report with the name PAR_USER, the url will be like...

 

http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/samples/AnnDetail&standAlone=flase&ParentFolderUri=/reports&j_username=jasperadmin&j_password=jasperadmin&PAR_USER=Value

 

Now use this url and you'll be directly taken to the report. No authentication, no dialog box asking for parameters.

 

Hope I made clear. Please ask if any confusion.

 

Link to comment
Share on other sites

One more thing. I replaced my Date type parameters of report with String type parameters and in my JasperReport query, I used TO_DATE. e.g. in the where clause of the query, it was like

Booking_Date >= $P{PAR_BOOKING_DATE} --This parameter is of Date type.

I did it this way

Booking_Date >= to_date($P{PAR_BOOKING_DATE},'dd/MM/yyyy') --Now this parameter is of String type.

Link to comment
Share on other sites

  • 6 years later...

This is an old thread, but I figured I'd post something I learned here just in case anyone is having a similar problem. My report uses a parameter that, for prompting purposes, I defined as a drop-down list. It essentially is a string value that gets assigned by the drop-down to the parameter. It works fine when prompted in JasperServer. If I tried to pass that parameter in a URL, it always used the default value.

The problem was that the Parameter Name in the report has to be exactly that same as the Parameter Name in the control. Jasper tells you that in the gray helper text on the Edit Input Control pane, but it's worth double-checking it. Sometimes it's the simplest solution that works!

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