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.

WinDev Mobile code:// Select the printeriConfigure()// Print the report based on "TABLE_CustomerTable"iPrintReport(RPT_CustomerReport)WebDev example:The information to print is contained in the Table control named "TABLE_CustomerTable"found in the "PAGE_Customer" page.The report to print is named "RPT_CustomerReport" and it is displayed in a PDF file duringa 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_CustomerReport_" + DateSys() + TimeSys() + ".pdf"// Prints the report in a PDF fileiDestination(iPDF, PDFFile)// Prints the report based on "TABLE_CustomerTable"iPrintReport(RPT_CustomerReport)// Displays the report in PDF formatFileDisplay(PDFFile, "application/pdf")// Deletes the filefDelete(PDFFile)12.5 Report based on a variable12.5.1 Printing a report based on a variableTo print a report based on a variable, you must:1. Initialize the value of the array variable used.2. Sort the array if necessary (with ArraySort).3. 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.4. Specify the name of the report to print with iPrintReport.WinDev and WinDev Mobile example:WinDev code:The "RPT_gglEventReport" report is a report based on the MyEvents variable of gglEventtype. This report is used to print the list of events found in a Google calendar.The "RPT_gglEventReport" report is printed during a click on the "Event" button. In thisexample, the click code of the "Event" button is as follows:// Open the preview windowiPreview()// Print the RPT_gglEventReport reportiPrintReport(RPT_gglEventReport)122Part 1: Report editor

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

Saved successfully!

Ooh no, something went wrong!