ODT Reportman Library

ODT Reportman library produces a MasonSQL reports using an .odt files as templates. The template files are created with the LibreOffice's application.
The reports are configured in public.odt_reports table which can be managed by users with ODT Reports web interface.

Permissions

To access a report an user must first add the report to the public.odt_reports table. For application specific reports the name of the report must also have app_schema_name. prefix.
The report permission is checked with the Permission() subroutine.

How to Correctly Configure Report Name

Once a report is prepared, it can be called from the MasonSQL application with [Stampa] or [St.sel] buttons or with customarily created buttons. The buttons must then call the report with printSelected() function, which triggers the generation of the report. The application composes the report name by using the PRINT_FORM method in combination with parameters passed to the printSelected() function. The report name is then searched in the database and report is generated from the provided input parameters. The report name is composed in the following order:
  1. The first part is the first parameter of the PRINT_FORM.
  2. The second part is the report parameter passed to the printSelected() function.
  3. In case the report parameter contains a suffix that indicates the report method, the suffix is excluded from the report name.

The application additionally checks the suffix, of the report parameter, to determine which report method to use. The only possible report methods are pdf, odt and rep. In consequence the application will report an error if it finds any other suffix after the dot character; Thus in case the report parameter contains dots the suffix after the last dot must be a valid report method. The report method suffix will not get included in the report name.

Stampa and St.sel Buttons Example

When the report is named after the corresponding menu, the [Stampa] and [St.sel] buttons should automatically become enabled. The user must also have the Print and PrintSel permissions.

For example for the public.anagrafiche table it is sufficient to set the name of the report to anagrafiche:

anagrafiche_ver2.png

Consequently in the Config->Anagrafiche menu has [St.sel] and [Stampa] buttons enabled:

Config_Anagrafiche.PNG

Custom Button Example

The example button directly calls printSelected() subroutine with sel type and report name concatenated with .pdf suffix:

<button onclick="<%$Display%>.printSelected('sel', '_my_report.pdf');">Example</button>

The report name could be complete report name but also it can be part of the report name. When the PRINT_FORM is defined its first argument can additionally define schema_name/table_name:

<%method PRINT_FORM>my_schema/my_table, PORTRAIT, PARAM1=3 %></%method>

In case of such PRINT_FORM definition, the actual report name in the public.odt_reports table must be my_schema.my_report.

Reference

The ODT Report POD reference is available.
Topic revision: r25 - 23 Mar 2017, JanezStangelj
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies