Jump to content

Recommended Posts

Posted

Hi,

I have a scenario below.

I need to print an Invoice together with an acknowledgement letter. (Seperate for each customer)

 

Sample data

Customer                  Invoice             Date                 Amount

A1                               INV001            01/01/2010     1000

A2                               INV002            03/02/2010      2000

A1                               INV003            03/02/2010      1500

 

Ineed to print as below

Acknowledgement (first Page)

Customer : A1

INV            Date                   Amount

INV001     01/01/2010       1000

INV003     03/02/2010        1500

                                                2500

after this need to print the above invoices (001 and 003) on seperate pages (page 2 and 3)

 

Acknowledgement (Page 4)

Customer : A2

INV            Date                   Amount

INV002     03/02/2010       2000

                                               2000

after this need to print the above invoice (002) on next page(page 5)

 

SO in total the file should be in 5 pages.

 

Can someone help..? Can subreports do this?

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Yes this can be done with JasperReport with 1 page and the help of 1 table and 1 subreport.

Main query (dataset):

Here you should make a query and GROUP BY Customer. This way it returns X (is amount of customers) record, and the whole report is repeated X times.

Table on first page:       

You have to define table on the first page. As parameter you should send the 'Customer' and then make a query for that tables that returns all the invoices of that parameter (Customer).

 

If you preview now, you'll see page 1 and page 4 (from your example)

Subreport on second page

Now you place a subreport on the second page. As parameter you give it 'Customer' as well, and you could use the same query: it returns the report as many times as there are records in teh result.

 

Good luck with it

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