We usually print header and details section of a document on same page, what if we want to print on different pages? And how to do this?
We can print header and details section of a document in different pages easily. To achieve this we have to place two different table controls, where one table control refers to header and another refers to details (lines), in a list control with a few properties change of these controls such as grouping, and page breaks, for example.
In this blog I’m printing sales header in first table and sales lines another, where each table data should print in different pages. To do this, we must first group the data into a single entity for each document using List control and after group each table controls, header table with header grouping and line table with details grouping, whereas sales header table control prints sales header information and sales line table control prints list of sales lines, and to print sales header and lines in separate with different pages, by setting up page break properties of each group.
Step by step:
1. Place a List control on report body section. List control is used to list entries one after another. As we place two table controls (Header and Lines) it list entries from each tables such as Header and its lines as one after another in different pages.
2. Place two table controls inside the List control, one after another vertically, for example, whichever order you wish, as shown below.
Screenshot 1: Shows Table controls inside List control.
3. We group sales document based on sales document number, hence we must group data in the list control as shown below.
Screenshot 2: Shows grouping List control.
Screenshot 3: Shows grouping with sales document number.
4. Group sales header table with sales document number. Follow the same steps done for the list control.
5. Apply parent grouping to sales line table as shown below. In sales line table we group sales lines based on sales document number because we need to print list of sale lines for each header.
Screenshot 4: Shows parent grouping of sales line table.
Screenshot 5: Shows how to add group header with parent grouping to sales line table.
Screenshot 6: Shows how sales lines table looks after grouping.
You can delete columns which are not necessary in the table.
6. After grouping has been done, you should apply page break to both table controls, as both inserts a new page when they finishes printing entries for each document, to print both sales header and details in different pages. Select the group in each table control and apply page break as shown below. To apply page breaks, select the group and open properties window of it as shown below.
Screenshot 7: Shows how to select the group to which page break applies.
Screenshot 8: Shows properties window of the group to apply page breaks.
Note: Reset page number for sales line table only as it indicates the end of a document and restart the page number with new document.
7. Add fields and parameters you wish to print in the report, as shown below.
Screenshot 9: Shows after grouping and fields.
8. Report output: First screenshot shows sales header and second shows relevant sales lines of the document shows in first screenshot.
Screenshot 10: Shows Header in first page.
Screenshot 11: Sales Lines in second page.
If you wish to discuss regarding this RDLC Report Design blog, please feel free to drop me an email to firstname.lastname@example.org.