13.07.2015 Views

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

Reports & Queries - Source : www.pcsoft-windev-webdev.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4. Configuring the print of page headers and footers for the nested report (iNestedHeaderFooter). Thisfunction can be used:• in the opening code of the main report: it will apply to all the nested reports that will be printed fromthe main report.• before printing the nested report: it will only apply to the next nested report.5. Printing the main report. See “Printing a nested report”, page 109 for more details.Note: To print reports with different orientations (portait/landscape), we re<strong>com</strong>mend that you use thesequencing of reports. This method is easy to implement. See “Sequencing the reports”, page 106 for moredetails.11.2.2 ExampleThe operations required to create nested reports are presented in the following example:The report named "RPT_OrderReport" is based on the "Orders" file. This report is used toprint the characteristics of each order (date, customer number, total amount, …). A breakon the "OrderNum" item is used to separate the different orders.The "QRY_ProductOrdered" query selects all the products of a specified order. This queryexpects an order number in parameter.The "RPT_ProductOrdered" report is based on the "QRY_ProductOrdered" query. This reportprints the products selected by the "QRY_ProductOrdered" query.The "RPT_ProductOrdered" report corresponds to the secondary report. This report will beprinted after each break.1. Create the "RPT_OrderReport" report. This report corresponds to the main report.2. Create the "QRY_ProductOrdered" query. See “How do I create a report?”, page 25 for more details.3. Create the "RPT_ProductOrdered" report. This report corresponds to the secondary report.Note: The Page footer block of this report will not be printed. See “Specific features of secondaryreports”, page 108 for more details.4. Enter the following code in the "Post-print" process of the Break footer block of the "RPT_Orders"report:// Initialize the query and pass in parameter// the number of the order currently printediInitReportQuery(RPT_ProductOrdered, My<strong>Source</strong>.OrderNum)// Print the nested reportiPrintReport(RPT_ProductOrdered)11.3 Specific features of secondary reports11.3.1 Blocks in the secondary reportWhen printing a secondary report (with iPrintReport), all the blocks of the secondary report are printedexcept for:•the Page header block.•the Page footer block.To print these blocks, use iNestedHeaderFooter.Note: If the secondary report contains a table whose header is found in the Page header block, only the Pagefooter block will not be printed (all the other blocks will be printed). In this case, the Page header block will beprinted before the first row of the table (found in the secondary report).108Part 1: Report editor

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!