Step by step: How to start with FastReport for developers

Prepare ownERP FastReport API

ownERP FastReport UI 

First it is necessary to fill ownERP FastReport UI with report templates in .frx format.

Log in to your ownERP FastReport interface through the browser

go to the menu item Upload and choose the .frx file report templates.

Find Standard Reports V12: https://gitlab.ownerp.io/fast-report/fr-core-yaml/-/tree/develop/v12/reports

and Standard Reports V13: https://gitlab.ownerp.io/fast-report/fr-core-yaml/-/tree/develop/v13/reports

Gitlab access only on request and for our customers.



The ownERP FastReport UI is now fully prepared.



Edit FastReports with the eQ ReportDesigner

To edit the given FastReport templates (.frx files) or create new ones you can use the eQ ReportDesigner Windows application. Find more information about this in the following link.

The SQLite database file (.db3) can be found in the server after downloading the reports for the first time. With this database file it is possible to render FastReport using the REST-API through a POST request. Example of this can be found in the section of this documentation: FastReport API.

For more details on the usage of eQ ReportDesigner and FastReport find here the official Fast Report Documentation for Users and Programmers.

Prepare Odoo system: first steps

Install modules

The first step to configure FastReport under Odoo systems is download the basis FastReport modules: 

  • EQ FastReport Basis - eq_fr_core

  • EQ FastReport Company - eq_fr_res_company

and then choose between one of the two modules for the API connection depending on the database type preferences:

  • EQ FastReport SQLite API - eq_fr_core_sqlite 

or 

  • EQ FastReport XML API - eq_fr_core_xml



The module EQ noupdate Standard Reports - eq_fr_core_noupdate should have installed automatically. Once the basis modules are installed it is possible to create the FastReport actions records.

If you want to activate the printing button for Sales, Invoices, Purchase or Inventory or use other FastReport functionalities, you must install the respective modules. However, the rest of the configuration in this documentation does not require these to be installed. 

Setup Company information and FastReport API connection

Go to Settings > Companies > Update Info



Setup the company information fields and the logo (right upper corner) to display in FastReport.



Go to FastReport page, enter your access data and carry out the connection test successfully. 



Then set the Base FastReport template, the original filename should be eq_fr_core_base.frx. If the original base template is edited then the filename will change.

Important

You have to set the basic report every time you make changes to the company, otherwise the change will not affect the reports.



Prepare Odoo system: new reports through interface

Find here the steps to create and render FastReport for new model: Project (project.project).

Create the FastReport template

First you need to have a .frx file. As the fields have not been selected yet and there is no database created for this model, start by duplicating the eq_fr_core.frx file and rename it as eq_fr_core_project.frx.

This is only an alternative, it is also possible to start by creating a new Report Template (.frx) from cero and customize it through eQ ReportDesigner.



Alternative 1: Through the eqReportDesigner application for Windows:

Select the eq_fr_core_base.frx file, add it to your local system and then press 'Report bearbeiten'.



Then Save the file with the new template with the new name: eq_fr_core_project.frx

Finally Upload the new report .frx file to the server.



Alternative 2: Through ownERP FastReport API UI

Download the eq_fr_core_base.frx file 

Then Upload a copy of the file with the new name: eq_fr_core_project.frx



Create the FastReport record

Go to Technical > Actions > Reports and create a new record with Report Type: Fast Report and add it to the 'Print' menu.

Set the other FastReport fields as in the following example:

IMPORTANT

The Template Name field is unique for each report must be the same as the one uploaded to the server in the step before, without the .frx suffix.



Set the FastReport fields

After creating the FastReport record, go to Technical > Database Structure > Fields and select the fields to use in the FastReport database.

Then in the 'Action' menu item select 'Extend the fields for the Report'.

Do not choose fields that reference the same model or any circular reference, as this will make the database unable to be created. See error in FAQ Section.



Choose the FastReport just created:



Get the database (this will change in the future)

Now we have the Report Template (eq_fr_core_project.frx) file and the Report Action, but we still need the SQlite database to be able to add the fields to the Template through eQ ReportDesigner.

To get this database go to the module associated to the FastReport model, in the example case: Projects, and print the new FastReport using the 'Print' menu item.

You will get an error like this:

This is because the .frx template file does not match to the SQLite database just created. However now you should be able to see the database file in your ownERP FastReport UI platform and in eQ ReportDesigner 'ReportData' section.

OwnERP FastReport UI:



EQ ReportDesigner 'ReportData' section:

 

Download the database

Download the database .db3 file to your local system.



 

Then open the eq_fr_core_project.frx with 'Report bearbeiten' and select Data > Add Data Source



Choose the database just downloaded and follow the steps below:

Customize the report

Find here an example of the edition and customization of a Project Report (eq_fr_core_project.frx):



When the new report is ready save it and and add it back to the server.



Now you are ready to print the new Project Document report.



Prepare Odoo system: new reports collect YAML files

It is also possible to export YAML files with the configuration just created using the Equitania python library: odoo-fast-report-mapper-equitania

First you need to setup the Report Action, the fields and the new Report Template (.frx) file explained in the section before. After that just need to install the python library and run the command line:

odoo-fr-mapper --server_path=/path/to/server/yaml/config --report_path=path/to/yaml/collection/directory --collect_reports=y

Then find the new YAML file with the Odoo system report information inside the server_path directory given. This YAML file can be used after to setup the FastReport just created in other Odoo systems, using the same library without the --collect_reports parameter.

Prepare Odoo system: standard reports through interface 

Create the FastReport record

Go to Technical > Actions > Reports and create a new record with Report Type: Fast Report and add it to the 'Print' menu.

Set the other FastReport fields as in the following example:

 

The Template Name is unique for each report must be the same as the one uploaded to the API without the .frx suffix.

The boolean field 'Report on Print Button' is only available when the respective EQ FastReport button module is installed.

Set the FastReport fields

After creating the FastReport record, go to Technical > Database Structure > Fields and select the fields to use in the FastReport database.

Then in the 'Action' menu item select 'Extend the fields for the Report'.



Choose the FastReport just created. 

The information about the fields to choose in this configuration can be found in the YAML files for the specific versions and models.

Then go to the module associated to the FastReport model, in the example case: Sales module, and print the new FastReport using the 'Print' menu item.



Prepare Odoo system: standard reports using YAML files

There is also a possibility to setup the FastReport using the Equitania python library created: odoo-fast-report-mapper-equitania. The steps to setup the Standard FastReport in the Odoo system using this python library and files needed can be found in this repository.

Setup Odoo system: edit reports

Find here the steps to edit an existing FastReport.

Add new fields

First select the new fields and add them to the report.

Get the new database (this step will change in the future)

Find the steps to get the database for the report here.

Edit the report in eQ ReportDesigner

Then start the eQ ReportDesigner application for Windows and add the new database downloaded to customize the file and add new fields to the report. Steps can be found here.

Finally Print the new edited report and see the changes applied.

 

Back to top