susobh.sugathan Posted March 31, 2015 Share Posted March 31, 2015 Hi,I have a scenario below.I need to print an Invoice together with an acknowledgement letter. (Seperate for each customer) Sample dataCustomer Invoice Date AmountA1 INV001 01/01/2010 1000A2 INV002 03/02/2010 2000A1 INV003 03/02/2010 1500 Ineed to print as belowAcknowledgement (first Page)Customer : A1INV Date AmountINV001 01/01/2010 1000INV003 03/02/2010 1500 2500after this need to print the above invoices (001 and 003) on seperate pages (page 2 and 3) Acknowledgement (Page 4)Customer : A2INV Date AmountINV002 03/02/2010 2000 2000after 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? Link to comment Share on other sites More sharing options...
gert_1 Posted March 31, 2015 Share Posted March 31, 2015 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 pageNow 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 Link to comment Share on other sites More sharing options...
Solution tchen Posted April 1, 2015 Solution Share Posted April 1, 2015 You do not need to use sub report to produce the report as per your design requirement. Please take a look at this wiki article for a sample report based on your requirement:http://community.jaspersoft.com/wiki/sample-report-using-one-report-template-display-summary-and-detail-group-data Link to comment Share on other sites More sharing options...
susobh.sugathan Posted April 3, 2015 Author Share Posted April 3, 2015 Awsome one. Thanks A Lot... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now