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

urgent:Multiple Queries on Single Report


rbojja

Recommended Posts

Hi all,

 

I am new to Jasper .I need to work on a report which is basically single report,but there are multiple queries in this.

 

eg: column header is based on query one .details are based on query two and like wise 3,4 queries.

 

I tried using subdataset and subreports.

 

can any one help me how to work furthur on this.As i am running short of time as i am commited to my client.

very urgent plz

 

Thanks,

Raghav

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi Raghav,

 

I had a similar requirement to run multiple queries and successfully used subreports. I don't think people can help you unless you give more detail of what specific problem you are experiencing and/or what exactly you are trying to achieve.

 

-stephen

Link to comment
Share on other sites

Hi ,

The requirement is i want to run a report based on four individual queries.

 

query one - page header

query two - Column Header

Query three - Detail band

query four - page footer

 

All this scenario i explained for better understanding of issue.

 

All the queries are independent of their own.

 

Thanks

Link to comment
Share on other sites

Jasper does not support multiple queries in one report file - you use sub reports for that. Sub datasets are only for crosstab reports and charts.

 

First:

1. Create a sub report for each of the three queries and the layout in the appropriate bands for the query data.

 

Next:

1. Create three separate groups in the main report.

2. Add a sub report to each group header band pointing at the sub reports you created in first part.

 

NOTE: You could have one query in the main report with the layout for that queries data in the main report and add only 2 sub reports for the other queries by creating 2 groups instead of three. Don't use default bands (Column header/footer, page header/footer summary) for sub reports as there is less control over the sub report layout from the top level that way.

Link to comment
Share on other sites

Hi ,

Can you explain a little bit more about point

1)1. Create a sub report for each of the three queries and the layout in the appropriate bands for the query data. ?

 

2. Add a sub report to each group header band pointing at the sub reports you created in first part. ?

 

 

can you explain a little bit more on these please

 

 

-Raghav

Link to comment
Share on other sites

Create a sub report as if it is a main report that has a query and lay out your data as if it is a self standing report but do not include page headers and footers (these will be done in the main report).

 

For each different query you create a separate file and lay out the data.

 

As long as the sub reports are referenced from a group band in the main report (create three groups with no "Group Expression" set), you can set the main report to always call the sub reports and does not need a query in the main report -> in "Report Properties" select the "More..." tab and for the field "When no data" select "All pages no detail" You must pass a report connection to the sub reports though so in the sub report report properties you must set the connection parameter.

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