- How to?
- Creating the editable report
- Characteristics of edit controls
- Events associated with an edit control in a report
- Input in the preview window
- Input in a PDF file
- Input in a report based on a PDF form
The report editor allows you to create reports that include edit controls. These reports can be generated in PDF format.
This gives you the ability to distribute reports (in PDF format if necessary) allowing the user to perform a direct input in the specified areas: administrative form (tax return, registration, ...).
The data can be printed or stored in a database (when the input is performed from the print preview). Then, the report becomes an entry form.
The edit controls can be used on all types of reports. In most cases, the edit controls are used on the Form reports
, using a PDF in report background for example.
Creating the editable report
To create an editable report:
- Create a report according to your requirements (see Creating a report for more details).
- Create the edit controls in the areas where the input will be performed: on the "Creation" pane, in the "Interactions" group, click "Edit".
- Save the report.
- During a print, the user will be able to directly enter data in the edit controls. The input is available:
- in the print preview.
- in the reports printed in PDF format.
Characteristics of edit controls
When creating an edit control in a report, you have the ability to define:
- the type of control (text, numeric, date, time),
- the associated mask: the available masks are the ones supported by the PDF format. They are available for the numerics, the dates and the times.
- the input size, which means the maximum number of characters allowed in the control. If this parameter is set to 0, there is no limit.
- the horizontal alignment,
- whether there is a border around the input area.
- the initial value,
- the style of caption and input area.
- Multi-line edit control: if the users enter more lines than what is visible, the non-visible lines will not be printed. During the input, the edit controls manage a vertical scrollbar.
- Style of input area: In this version, only the "Arial" font can be used.
- The edit control is not linked to an item found a data file or in a query, nor to a variable. To display information coming form a data file, a query or a variable, the control must be assigned by programming.
- The border of the input area cannot be configured (thickness, color, ...). You only have the ability to make it visible or invisible.
- No currency type can be used (the Euro symbol is not supported).
- It is not possible to make calculations between the different input fields.
Events associated with an edit control in a report
The following events are associated with an edit control in a report:
|Initializing||Run when opening the report.|
|Before printing||Run before printing a control.|
|Entry||Run when the input cursor enters in the control.|
|Exit||Run when changing control (TAB key, change of control with the mouse, ...).|
|Modification||Run whenever the content of the control is modified (typing or erasing a character for example).|
Input in the preview window
When a report is displayed in print preview, the edit controls are enabled.
In this case, the user will be able to enter the requested information and print the report in one of the available formats. A message is displayed in the print preview to inform the user of the ability to enter information.
By default, the user can browse the edit control via the TAB key: the available controls are browsed from top to bottom and from left to right.
- The events associated with edit controls are run when the controls are handled in the print preview.
- The data coming from the database can be displayed by programming. Simply link the report to a data file or to a query and assign the desired item to the edit control in the event "Before printing".
- The data modified by the user in the preview window can be saved by programming. Let's take a simple example, the modification of a record displayed in the report. In each edit control whose value must be modified, you must:
These actions are performed in the event "Exit from control".
- assign the entered value to the item,
- modify the record.
For example, to modify the customer name, the corresponding code is as follows:
Customer.Name = EDT_Name
When a report is printed in a PDF file, the edit controls are enabled. In this case, the user will be able to enter the content of the different edit controls and to print the PDF file with the entered values.
- The edit controls are used to enter information in the PDF file. This information will be used during the print. If the end user owns a full version of Adobe Acrobat, the data entered can be saved in PDF format (Acrobat Reader cannot be used to save the PDF files).
- The data coming from the database can be displayed by programming. To do so, link the report to a data file or to a query and assign the requested item to the edit control in the events "Initializing" or "Before printing" of the edit control.
Input in a report based on a PDF form
The edit controls are well suited to the "Form" reports. The "Form" reports are based on an image file or on a PDF file.
For a PDF form containing several pages, you have the ability to create a report displaying the different pages of the PDF file ("Print all the pages found in the PDF" option in the "Background" tab of the report description).
These pages are visible and they can be modified in the report editor: the edit controls can be positioned on any report page.
Training (WINDEV): WD Reports
This page is also available for…