panlj2004 Posted August 4, 2015 Posted August 4, 2015 Hello all,This is an odd issue for me, I have a parameter f_year and define it inside query in Jaspersoft Studio-6.1.0.main report query table query There are 2013,2014,2015 in the year column, but the spool records is wrong.Ex: when I entered 2013, all records include 2013,2014,2015 displayed.When I entered 2015, all records include 2013,2014,2015 also displayedWhen entered 2012, no records displayed, it proved the parameter is working. I don’t know what’s wrong. Please helpThank you in advanceKelly
hozawa Posted August 4, 2015 Posted August 4, 2015 Check the datatype and data format of the database column and the parameter to make sure they match.
panlj2004 Posted August 4, 2015 Author Posted August 4, 2015 Thank you Hozawa,the data format of the database is "int", the class I used "java.lang.String" ,"java.lang.Integer" I also used, but the spool data still wrong.I used same way to set the parameter for bar char, it is correct, but for table, it is wrong, it is strangeKelly
zh3ntil Posted August 4, 2015 Posted August 4, 2015 You didn't pass the parameter the dataset which is fill your table. That's why it behaves anormal. your report response when you enter '2013' or '2015' because your main dataset return a result set. When you enter '2012' there is no record on main dataset, so report shows no record found.If your main dataset return no result, your report always shows no record.The best approach for this case: - If your main dataset doesn't fill a component on report. Just write something like 'select 1 as temp'. So your main dataset always returns something - Pass the parameter to table dataset. Click your table component, go to 'dataset' section. Hit the 'parameters' button. Match the main report parameter and table dataset parameter. Before do that, You should create a parameter in your table dataset. - for table dataset, write your query with paramater. You can use your main dataset query that you wrote in your question.I hope this will help your case...
hozawa Posted August 5, 2015 Posted August 5, 2015 zh3ntil has a point. Check the following thread on how to pass parameter to a dataset. Try outputing the parameter in a table to make sure value are being passed correctly.http://community.jaspersoft.com/questions/823038/passing-main-parameter-sub-datasets-jasperstudio
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