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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

WebDev example:The "RPT_ParamReport" report is used to print the invoices of a specific customer forJanuary 2008.The lower bound corresponds to "01/01/2008" and the upper bound to "01/31/2008".This report expects the customer number in parameter.This report is displayed in a PDF file during a click on the "Print" button.In this example, the click code of the "Print" button is as follows:// Generates a unique file namePDFFile is string = fWebDir() + "\" + ..."RPT_ParamReport_" + DateSys() + TimeSys() + ".pdf"// Configures the destination of the printiDestination(iPDF, PDFFile)// Prints the report while passing bounds and parametersiPrintReport(RPT_ParamReport, "01012008", "31012008", ...CustNum)// Sends the file to the browserFileDisplay(PDFFile, "application/pdf")12.3 Report based on a queryTo print a report based on a query, you must differentiate between two cases:• Report based on a query without parameter.• Report based on a query with parameters.Notes:• If parameters must be passed to the report, these parameters must be specified in iPrintReport, afterthe name of the report to print.• <strong>Source</strong>Name used in the code of the report allows you to find out and modify the name of the queryassociated with the report.12.3.1 Printing a report based on a query without parameterTo print a report based on a query without parameter, you must:1. Configure the destination of the print:•In WinDev: use iPreview (print preview, print in an HTML file, …).•In WebDev: use iDestination (print in an HTML file, …).• In WinDev Mobile: use iConfigure or iParameter. These functions open a dialog box allowing the userto select the default printer.2. Specify the name of the report to print with iPrintReport.For example:• To print the "RPT_QueryReport" report in WinDev:// Open the preview windowiPreview()// Print the QueryReport reportiPrintReport(RPT_QueryReport)Part 1: Report editor 119

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

Saved successfully!

Ooh no, something went wrong!