Jump to content

How to avoid 2 calls to database? No Data section and Table.


mwarner_2

Recommended Posts

I have a report with a table component (for export to Excel).
Also the report has a No Data section, to show the user if they made input control selections that result in no data being returned.  This section has an error message as well as their selections.
 

So the way Jaspersoft handles this sort of a report: it first quieres the database in the Main Report, to see if there is any data.  If not it goes to the No Data handling.
If there is data, then the table component is run, which results in a second query to the dataset.
This is at least twice as inefficient as it should be.

Is there any way to make this work with only one query to the database?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

If the 2 queries are exactly the same, then maybe you do not need to use a list(with a subdataset and the same query as the main one). You could have the contents of the list placed directly in the detaild band. But we are just guessing here. That's why we need a sample JRXML to work on.

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