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

Wrong spool data when use parameter.


panlj2004

Recommended Posts

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

table4.PNG.74436743bdfd5ff86e877a574e0cd330.PNG

 

table query 

table5.PNG.237ecc5293aa99ac3a125b56f13eae09.PNG

 

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 displayed

When entered 2012, no records displayed, it proved the parameter is working.

 

I don’t know what’s wrong.

 

Please help

Thank you in advance

Kelly

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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 strange

Kelly

Link to comment
Share on other sites

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

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