Jump to content

Two separate queries in a report


Recommended Posts

Hello Everyone, here is the situation:


We are writing reports for an application that has user-configurable labels for data fields. We would like to be able to write reports in iReport that can load the label information into an array and then use that array to create the labels for the report.

Is there any way to do this?

If not, does anyone have any other ideas on how we can create a report with user-specific, data-driven field labels?



Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I am not really following what your use case is, but based on the subject of your post, I will try to give you an idea.

If you are looking to create a report that has two queries that are run, you can do so with a subreport - you can have a subreport that you pass information into from the main report and then use that within the query of the subreport, and pass the results back to the subreport.  So, if you have your main report with a query and then you pass the result to the subreport and run another query based on that, you may be able to acheive whatever it is that you are looking for.

Link to comment
Share on other sites

Thanks for the suggestion. What we have is an application in which the users can change the labels of data fields as they appear in the application. We would like the customized labels to appear for the user when they run a report.


Our current approach was to write a database function that we call in the query for the report that returns what the label should be. This is painfully slow, however, multiplying the runtime by up to 5x.


We had thought if we could run a separate query and load the results into a map we could then use that map to determine what the field labels should be.


Using a sub-report might be a good way of doing this. Though it has challenges as well: Every field in the report would have to be passed to the subreport in some form so the lookup could be performed and then each field label would have to be passed back. Though, perhaps we could send an array back...



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