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

Combining results of multiple queries into a single report


adunn

Recommended Posts

My company is new to jasper reports and I'm trying to create what I believe to be a relatively simple report but I'd like to know the best way to approach this. I've created a relatively simple query to return sales for the current year by account.

Example:

Account NameYTD Sales
Account A1,234
Account B3,456
Account C789

Now I want to add another column for Last Year's Sales. It's simple enough to build the query, but how do I now add this as a column?

- Create a subreport for Last Year's Sales with Account as a parameter and Sales as a return variable?

- Similar to the above, but using a subdataset?

Obviously, I can do this using a complex SQL statement but I don't feel like that's the best way. (Also, I plan to add some other columns to this report that may not be so easy to do by extending a complex sql query).

Thanks for any help. I have found the documentation and Online Learning Portal to be a bit lacking for anything but the basics, so if there's any resurces out there for dealing with more complex reports that would be greatly appreciated as well.

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

As you stated, there is more than one way to accomplish adding the additional query. For what you want, I would use a subreport.

Have you seen the online Jaspersoft Studio tutorials? http://community.jaspersoft.com/wiki/jaspersoft-studio-tutorials-archive We are adding more of them all the time, not just for product releases. In addition, if you write one (or need one) there is a link to send the team email about it. We'd love help getting more up there!

Regards,
Ilona

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