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.

WebDev example:The Web user selects the reference of an order in a list. The "Print" button is used to:• create the HFSQL view named "OrderView" containing the lines of the selected order(HCreateView).• view the "RPT_ViewReport" report in a PDF file (iPrintReport).In this example, the click code of the "Print" button is as follows:// Create the viewIF NOT HCreateView("OrderView", ORDLINE, "*", "Rerence",..."", "", hViewExclusive + hViewBreakable) THENError(HErrorInfo())ELSE// Generates a unique file namePDFFile is stringPDFFile = fWebDir() + "\" + "RPT_ViewReport_" + ...DateSys() + TimeSys() + ".pdf"// Configures the destination of the printiDestination(iPDF, PDFFile)// Prints the RPT_ViewReport reportiPrintReport(RPT_ViewReport, "OrderView")// Sends the file to the browserFileDisplay(PDFFile, "application/pdf")END12.7 Report based on a memory zoneTo print a report based on a memory zone, you must:1. Create the memory zone with MemCreate.2. Add records into the memory zone with MemAdd and sort these records (if necessary) with MemSort.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, ...).4. Specify the following parameters with iPrintReport:• the name of the report to print.• the name of the memory zone used.5. Delete the memory zone with MemDeleteAll at the end of the report print.Notes:• To optimize the resources used on a Pocket PC, printing a report based on a memory zone is notavailable in WinDev Mobile.• If additional parameters must be passed to the report, these parameters must be specified in iPrint-Report, after the name of the memory zone used. See “Report with parameters”, page 139 for moredetails.• ..MemZoneName used in the code of the report allows you to find out and modify the name of thememory zone associated with the report.• ..<strong>Source</strong>Name used in the code of the report allows you to find out and modify the name of the basedata for the memory zone associated with the report.126Part 1: Report editor

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

Saved successfully!

Ooh no, something went wrong!