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 code:// Generates a unique file nameMyFile is string = fWebDir() + "\" + ..."RPT_QueryReport_" + DateSys() + TimeSys() + ".htm"// Configures the destination of the printiDestination(iHTML, MyFile)// Passes the parameters to the query associated with the// reportiInitReportQuery(RPT_QueryReport, CompanyName, CompanyType)// Prints the RPT_QueryReport reportiPrintReport(RPT_QueryReport)// Extracts the name and extension of the generated fileFileName is string = fExtractPath(MyFile, ...fFileName + fExtension)// Sends the file to the browserFileDisplay(FileName)Note: If some of the parameters expected by the query are not specified (value corresponding to NULL forexample), the selection conditions corresponding to these parameters will be ignored.12.4 Report based on a Table controlA report based on a Table control can only be printed from the window displaying the Table control to print. Ifthe button was not created automatically, you must:1. Create a button in the window or in the page containing the Table control.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 name of the report to print with iPrintReport.Notes:• If additional parameters must be passed to the report, these parameters must be specified in iPrint-Report, after the name of the report to print. See “Report with parameters”, page139 for moredetails.• ..SelectionOnly is used to find and modify the records that will be printed in the report: print all therecords or the selected records only.WinDev and WinDev Mobile example:WinDev code:The information to print is contained in the Table control named "TABLE_CustomerTable"found in the "WIN_Customer" window.The report to print is named "RPT_CustomerReport" and it is printed during a click on the"Print" button.In this example, the click code of the "Print" button is as follows:// Open the preview windowiPreview()// Print the report based on "RPT_CustomerReport"iPrintReport(RPT_CustomerReport)Part 1: Report editor 121

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

Saved successfully!

Ooh no, something went wrong!