ermandeep_singh Posted May 17, 2012 Share Posted May 17, 2012 Hi..I am using single select query input control.It seems that it is filling with values from database but the values displayed are either [NULL] or Blank. Please help me knowing problem and its solution..Its really very urgent. Thanks in Advance.Mandeep Link to comment Share on other sites More sharing options...
marianol Posted May 17, 2012 Share Posted May 17, 2012 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 More sharing options...
ermandeep_singh Posted May 17, 2012 Author Share Posted May 17, 2012 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 More sharing options...
marianol Posted May 17, 2012 Share Posted May 17, 2012 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 More sharing options...
ermandeep_singh Posted May 18, 2012 Author Share Posted May 18, 2012 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 More sharing options...
shteng87 Posted June 1, 2012 Share Posted June 1, 2012 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 More sharing options...
oesina Posted June 1, 2012 Share Posted June 1, 2012 Hi,When you define your Data Query in iReport Designer, you can make something like the followingSelect * 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 queriesHope that helps,Olga Link to comment Share on other sites More sharing options...
oesina Posted June 1, 2012 Share Posted June 1, 2012 You can also make calculations inside parameters. Then you only need two parameters (note the order) and no subreport. Samples attached for collection and string parameters. Link to comment Share on other sites More sharing options...
oesina Posted June 1, 2012 Share Posted June 1, 2012 Samples attached for collection and string parameters. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now