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.

In this example, the click code of the "Print" button is as follows:nSubscript is int// Create the memory zoneMemCreate("MemZone")// Browse the Recipient list and// initialize the memory zoneFOR nSubscript = 1 TO Recipient..Occurrence// Find the current recordHReadSeek(Customer, Name, Recipient[nSubscript])IF HFound(Customer) = True THEN// Add elements into the memory zoneMemAdd("MemZone", "", HRecNum())ENDEND// Generates a unique file nameMyFile is stringMyFile = fWebDir() + "\" + "RPT_MemZoneReport_" + ...DateSys()+TimeSys() + ".pdf"// Configures the destination of the printiDestination(iPDF, MyFile)// Prints the reportiPrintReport(RPT_MemZoneReport, "MemZone")// Destroy the memory zoneMemDeleteAll("MemZone")// Sends the file to the browserFileDisplay(File, "application/pdf")12.8 Report based on a text filePrinting a report based on a text file is identical regardless of the method used to read the records (automaticor programmed). To do so: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. 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.• ..<strong>Source</strong>Name used in the report code allows you to find out and change the name of the text associatedwith the report (when the reading of records is automatically performed).WinDev and WinDev Mobile example:The "RPT_CustomerReport" report is based on the "Customer.TXT" file. This text file containsthe characteristics of the customers.The "RPT_CustomerReport" report is printed during a click on the "Customer" button.128Part 1: Report editor

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

Saved successfully!

Ooh no, something went wrong!