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

Single Select query input control


ermandeep_singh

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Are you creating the input control from the Server UI or from iReport? Can you add some screenshots?

My take without any extra information and assuming that you are using the Server UI to create the input contol is that you are not clicking on "add" in the Visible column after you put the column name that should be visible.

Check the my screen shots, in that sample my query is "SELECT username, member_pk FROM users_table"

Link to comment
Share on other sites

I got it fixed but I don't know what was the problem.Now got a new problem I changed my query in Ireport and it is generating a good report in Ireport itself but no data is being shown in Jasperserver..Again it was working bt then somehow started getting this problem.

 

And also can you please tell me if the input controls are not aligned in a good manner,how to fix that?

I have 4 input controls and 3 are looking good but 4th one is not aligned in parallel to them.

Link to comment
Share on other sites

 Can you post a screenshot of the input controls?

As for the report make sure that you have deployed the report with the new query to Jasperserver, also make sure that when you deploy the report you have the report definition (the .jrxml) file saved in iReport.

Mariano

Link to comment
Share on other sites

 Mariano,

Can you tell me how can we manage optional input controls.Suppose I am choosing a country from single select query in the control and report is being generated according to that country only..But what If I don't select any country and I want it should produce results for all countries..How to do that ? I am using Mysql database and I am unable to perform this in Ireports as per now.

One more thing,what if I want to display 'ALL' in the single select query at the top of other values which are being fetched from database using a query.And on selecting 'ALL' It should return records for all cities.

 

Can we do this?

Please reply soon.

Anybody ?

Regards,

Mandeep.

Link to comment
Share on other sites

  • 2 weeks later...

 Hi,

 

I am facing this problem too. Urgently need this solution.

 if I want to display 'ALL' in the single select query at the top of other values which are being fetched from database using a query.And on selecting 'ALL' It should return records for all

Link to comment
Share on other sites

Hi,

When you define your Data Query in iReport Designer, you can make something like the following

Select * from table $P{where_parameter}

You need to define dummy master report with 1 parameter: country_list collection and one Variable where_variable String, that should calculate expression if the collection length is >0.

 

This formula works for me:

$P{country_list}>null?'Where $X{IN,country,country_list}':''

Then you need to create Subreport that passes the variable definition as a parameter, because only parameters can be used in a data query, not the variables.

Check more details here: using $v variables in sql queries

Hope that helps,

Olga

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