- Ad-hoc reports right from the Window Tab (click on the Report icom or ALT-R). You use the Search button to select the records you want to report on.
- List Reports you start from the menu with optional parameters
- Forms (like Invoices, ...)
All reporting in Compiere has two parts: The data ("model") and the format ("view").
You can have multiple views on the same model (Model Driven Architecture) - i.e. you use the invoice data to create a daily invoice report and a customer history report - you would use different columns, different sorting and different summary information, but it is based on the same data (model).
In this posting, I'll concentrate on how to add a new model for reporting. For that, you can use database tables directly, or database views. The creation of a vew is much easier in Compiere, as you do not have to de-reference the fields. Example: when you want to list the payment term of an invoice, you just add the column C_PaymentTerm_ID to the report, Compiere autimatically re-references the ID and prints the name of the payment term.
When using a third party reporting tool, you would have to program the view to display the payment term name. Also, in Compiere reporting, all security rules are automatically applied - example: if a user of the system would not have access to the payment term, you would have to create a separate report for that user. So, to create a custom report, you "just" have to create a database view.
In the current version of Compiere, you have to use a database tool to develop the view.
Steps:
With a database tool of your choice, create a view. (If you want to add the column TaxCheckDate we created in the posting "Add a new Column" to the business partner detail report, you would just modify the view RV_BPartner and add the field TaxCheckDate).
Log in with the System Administer role.
Open the window: Table and Column
- In the tab Table, search for your table or view; if the table or view does not exist, enter the DB Table Name (or view name). The Data Access Level determines, who by default will get access to the table or view. Save the record.
- Click the button Create Columns from DB - this will create the columns which do not already exist in the Compiere Application Dictionary.
- Go through the (new) columns created. The main item to check is the field Reference. In most of the situations, the system will derive the correct data type. Details on the Reference are discussed in detail in the Compiere Technical class.
- If you created a new Table, you need to create a record referencing the table. Report views allow you to select a subset of the data (via a sql where clause) or create function columns (usually totals using the SUM function)
- Create a new record - make sute that the checkbox Report is selected, and select the Report View you created in the previous step. Select the Data Access Level to determine, who by default will get access to the report.
- In the tab Parameter you can add any optional or mandatory parameter. Use the System Element to use consistent terminology
- Create new a Menu item with Action Report and select your report defined in the previous step
- Position the new Menu item in the tree
- Execute Synchronize Terminology will ensure that the process name you defined is used in the menu and that the process parameters use the standard terminology used in the System Element.
- By default, the new report is added to the roles with the access level specified for the report.
- Optionally run the process Role Access Update to ensure that the roles have access to the new report.
- For roles which are maintained manually, in the window Role add the report to the list of processes in the tab Process Access.
Log in again with the user name and role and run the report. When you run the report the first time, create the format layout by selecting the columns, selecting the sort order and the break columns.