To display a report in PDF format in the browser of the Web user, you must:

generate the PDF file on the Web server.

display the generated file in the browser of Web user. The display of the file can be:

immediate.

requested by the web user (click performed on a link for example).

delete the PDF file from the Web server.

How to proceed?

Generating a PDF file on the Web server

To generate a PDF file on the Web server:

Create a unique name for the PDF file to generate. 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). See Defining a unique name for the generated file for more details.

Configure the destination of the print with iDestination associated with the iPDF constant (print in a PDF file).

Specify the name of the report to print in iPrintReport. The PDF file is created on the Web server.

Displaying the PDF file

The display of the file can be:

immediate.

requested by the web user (click performed on a link for example).

To automatically display the file generated in the browser of the Web user, all you have to do is use FileDisplay.

modify the URL of the control that displays the PDF file (..URL property of a button or link for example).

...

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 delete the report once it has been displayed or you can create a procedure used to delete the reports created during the day for example.

Example

The "RPT_InvoicePDF" report is displayed in PDF format on the computer of the Web user.

The "ShowInvoice" button is used to:

generate the PDF file in the "<MyProject>_WEB" directory of the site.

show the report in PDF format.

delete the report in PDF format once it has been viewed.

In this example, the server click code of the "ShowInvoice" button is as follows: