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.

WinDev code:// Open the preview windowiPreview()// Print the RPT_gglEventReport report// while passing parametersiPrintReport(RPT_gglEventReport, Organizer[1])WinDev Mobile code:// Select the printeriConfigure()// Print the RPT_gglEventReport report// while passing parametersiPrintReport(RPT_gglEventReport, Organizer[1])WebDev example:The "RPT_gglEventReport" report is displayed in a PDF file during a click on the "Print theorganizer events" link. Then, the PDF file is displayed in the browser. This report expects inparameter the organizer for which the events must be listed.In this example, the click code of the "Print" button is as follows:// Generates a unique file nameMyFile is string = fWebDir() + "\" + ..."RPT_gglEventReport_" + DateSys() + ...TimeSys() + ".pdf"// Prints the report in a PDF fileiDestination(iPDF, MyFile)// Prints the RPT_gglEventReport reportiPrintReport(RPT_gglEventReport, MyOrganizer)// Displays the report in PDF formatFileDisplay(MyFile, "application/pdf")// Deletes the filefDelete(MyFile)Notes:• The variable must have been created and initialized before printing the report.• If additional parameters must be passed to the report, these parameters must be specified in iPrint-Report. See “Report with parameters”, page 139 for more details.• ..<strong>Source</strong>Name used in the code of the report allows you to find out and modify the variable associatedwith the report.12.6 Report based on a HFSQL Classic viewTo print a report based on a HFSQL Classic view, you must:1. Create the HFSQL view with HCreateView (or HMergeView).2. 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.3. Specify the following parameters with iPrintReport:• the name of the report to print.• the name of the HFSQL Classic view used.124Part 1: Report editor

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

Saved successfully!

Ooh no, something went wrong!