Official Content

You can create a PDF report by defining a Procedure object with Layout. After that, to be able to run it in PDF format, you must set the following properties and define the following rule in the Procedure:

Properties


Rule

Requirements

Acrobat Reader (or any other PDF viewer) must be installed on the client.

Sample

Consider the following Transaction object:

Customer
{
  CustomerId*
  CustomerName
  CustomerAddress
  CustomerPhone
}
 

Suppose you need to implement a PDF report that lists the name and phone of all the customers.

To do so, first of all, you have to create a Procedure object.

Next, configure the Procedure properties as follows:

Go to the Rules tab and write:

Output_File("CustomersReport","PDF");

Go to the Layout tab. You will see one predefined Printblock (named "printBlock1"). Insert the Customer attributes you want to list inside that Printblock:

image_20231024213840_1_png

Finally, in the Procedure Source define the following code:

For each Customer
   Print printBlock1
endfor

Page sizes

All the page sizes that can be used in GeneXus are supported:

Type Dimensions
Letter 8 1/2 x 11 inches
Office 8 1/2 x 14 inches
Executive 7 1/4 x 10 1/2 inches
A4 210 x 297 mm
A5 148 x 210 mm
B5 182 x 257 mm
Envelope #9 3 7/8 x 8 7/8 inches
Envelope #10 10 4 1/8 x 9 ½ inches
Envelope DL 110 x 220mm
Envelope C5 162 x 229 mm
Envelope B5 176 x 250 mm
Envelope Monarch 3.875 x 7.5 inches
User Size

Fonts

They are not automatically embedded in the generated PDF. Therefore, if you need to embed a specific font, please read: How to embed a font in the pdf.

For supported fonts, see How to use Cyrillic characters in a PDF?

Settings

PDF report settings should be configured in the PDFReport.ini file.

Set the following PDFReport.ini properties to generate a PDF file with a fixed page size such as A3, A4, Letter.

  • LeftMargin = 0
  • TopMargin = 0

By default, PDF files are generated using version 1.4.

If your Knowledge Base has the Java Generator or .NET Generator as Environment, you can configure the library you want to use to generate the PDF reports. To do this, set the appropriate value in the PDF Reports Library property.

Videos

Start Video PDF Reports and For each command to query the database

See Also

Web printing on client printer (without an applet)
SAC # 34500

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant