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

Pass report a parameter without user input.


munga

Recommended Posts

I have a report that is to be used multiple times with a different parameter division_id. So I don't have to recreate the report and all its sub-reports, can I specify a value to be used in the input control without the user having to enter the value?

The reason I don't want the user to enter a value is each divisional manager should not be able to see the other divisions reports, and as they should only see one report entering a value in should not be necessary.

If this can't be done with an input control can it be done another way?

Thanks
Munga



Post Edited by munga at 01/17/2012 00:26
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I've had partial success, I've found that if you use a single select drop down list and make the input control maditory and read only it stops the user from changing the value but they still have to apply the input controls before the report will run which seems unnessary as it is the only option.

Does anyone know how to force to apply with out user input, I thought making the input control invisible would have remove the need for the user to apply the controls but it doesn't.

Thanks
Munga

Link to comment
Share on other sites

  • 1 month later...

I didn't understand very well what you mean!

I try to guess:

Do you have report with ID column and clicking them you want to pass it value to another report to accomplish another task without ask again the user input? Is it right?

In that case, right-click on the field you want to pass, go to link and set this two parameter:

 

1)

name = _report

value = "report to execute"

2)

name = "Name of the parameter"

value = "Value of the parameter to pass"

then when the report is uploaded to jasper select the report modify it and uncheck the checkbox promt as user and there you go!

 

Hope this could help you!

Cheers,

Marco

Link to comment
Share on other sites

Munga

 

i am having exactly the same problem.

in generic terms, this is what i have

in the sql for the report i have "select data from table where pk>=$P{param_pk}

i have a parameter definied, param_pk

i have an input control defined, single select query, mandatory, read-only, this value is pulled from the database pseudo-sql "select value from settings where setting_name='param_pk'

this works fine, it displays teh input control, press apply and it works as you would expect

 

now all i want to do is to prevent the user from having to press apply - it is a redundant step as the input control is read-only

as soon as i make the input control invisible, i get the error "You must apply input values before the report can be displayed."

 

have you found a away around it

Link to comment
Share on other sites

i have just answered my own question ( i found something whilst looking back through old forum posts)

i now have the input control set as mandatory, read-only, visible

 

in ireport, right-click properties of the report

3rd tab, other, uncheck "always prompt"

 

hope that helps soembody else

Link to comment
Share on other sites

Hi nikalopolis,

I've already tried that combination and I was unable to run the report as the only parameter checkbox was un checked and greyed out. When I click the apply button all I got was an error that informed me that I must select a parameter.

munga.

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