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.

• To print the "RPT_QueryReport" report in WinDev Mobile:// Select the printeriConfigure()// Print the QueryReport reportiPrintReport(RPT_QueryReport)• To print the "RPT_QueryReport" report in WebDev, in a file in HTML format:// Generates a unique file nameHTMFile is string = fWebDir() + "\" + ..."RPT_QueryReport_" + DateSys() + TimeSys() + ".htm"// Configures the destination of the printiDestination(iHTML, HtmFile)// Prints the RPT_QueryReport reportiPrintReport(RPT_QueryReport)// Extracts the name and extension of the generated fileFileName is string = fExtractPath(HTMFile, ...fFileName + fExtension)// Sends the file to the browserFileDisplay(FileName)12.3.2 Printing a report based on a query with parametersTo print a report based on a query with parameters, 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. Pass the parameters to the query with iInitReportQuery.3. Specify the name of the report to print with iPrintReport.For example: The "RPT_QueryReport" report is based on a query with parameters. The parameters expectedby the query are the name and type of the <strong>com</strong>pany. These parameters have been entered in the window forstarting the report print.WinDev code:WinDev Mobile code:// Open the preview windowiPreview()// Pass the parameters to the query associated with the//reportiInitReportQuery(RPT_QueryReport, CompanyName, CompanyType)// Print the list of <strong>com</strong>paniesiPrintReport(RPT_QueryReport)//Select the printeriConfigure()// Pass the parameters to the query associated with the// reportiInitReportQuery(RPT_QueryReport, CompanyName, CompanyType)// Print the list of <strong>com</strong>paniesiPrintReport(RPT_QueryReport)120Part 1: Report editor

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

Saved successfully!

Ooh no, something went wrong!