AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / Editores / Editor de reportes / Impresión en WEBDEV
  • Overview
  • How to?
  • Generating a PDF file on the Web server
  • Downloading the PDF file
  • Deleting the PDF file
  • Example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Downloading a report in PDF format on the computer of the Web user
Overview
To propose to download a report in PDF format on the computer of the Web user, you must:
  • generate the PDF file on the Web server.
  • propose to download the generated file on the computer of the Web user.
  • delete the PDF file from the Web server.
How to?

Generating a PDF file on the Web server

To generate a PDF file on the Web server:
  1. Create a unique name for the PDF file to be generated. The creation directory of this file must be accessible in read/write (the directory of the data files or the "<MyProject>_WEB" directory of the site for example).
    For details on how to create a unique file name, see Defining a unique name for the generated file.
  2. Configure the print destination with iDestination associated with the iPDF constant (print in a PDF file).
  3. Specify the name of the report to print in iPrintReport.
    The PDF file is created on the Web server.

Downloading the PDF file

To propose to download the generated file on the computer of the Web user, use FileDisplay.

Deleting the PDF file

To reduce the disk space occupied by the reports in PDF format on the Web server, we advise you to delete the unused reports on a regular basis. You can, for example, remove the report once it has been downloaded or create a procedure used to erase the reports generated during a day.
Example
The "RPT_OrderPDF" report is a report in PDF format proposed for download.
The "BTN_DownloadOrder" button is used to:
  • generate the PDF file in the "<ProjectName>_WEB" directory of the site.
  • propose to download the report in PDF format.
  • delete the PDF report once it is downloaded.
In this example, the server click code of "BTN_DownloadOrder" button is as follows:
// Generate a unique PDF file name
AFile is string = fWebDir() + "\" + DateSys() + TimeSys() + ".pdf"  
// Configure the destination of the print
iDestination(iPDF, AFile)  
// Print the RPT_OrderPDF report
iPrintReport(RPT_OrderPDF)  
// Propose to download the file
// The file name proposed by default will be "Order.pdf"  
FileDisplay(AFile, "application/pdf", "Order.pdf")  
// Delete the file
fDelete(AFile)
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 02/05/2023

Señalar un error o enviar una sugerencia | Ayuda local