Difference between revisions of "Report"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
m (Intermediate save - more to follow.)
(Undo revision 48377 by Thomas Thießen (Talk) - German translation overwrite english version)
 
(10 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
[[Category:Functionality]]
 
[[Category:Functionality]]
 
[[Category:User documentation]]
 
[[Category:User documentation]]
 +
[[Category:Table of Contents]]
 +
[[Category:Documentation]]
  
 
The Report function provides a way to generate simple reports based on the data being viewed.
 
The Report function provides a way to generate simple reports based on the data being viewed.
Line 30: Line 32:
 
It is possible to modify the report formats and add others so that there is a choice of what you want to see when you click the report button.  For more information on the possibilities, see [[Print Formats]].
 
It is possible to modify the report formats and add others so that there is a choice of what you want to see when you click the report button.  For more information on the possibilities, see [[Print Formats]].
  
It is also possible to override the internal report mechanism and create the reports with Jasper Reports.  See [[Compiere_JasperReports_Integration_HowTo|Jasper Reports Integration]] for more information.
+
It is also possible to override the internal report mechanism and create the reports with Jasper Reports.  See [[ADempiere/Compiere_JasperReports_Integration_HowTo|Jasper Reports Integration]] for more information.
  
 
When the report menu or icon ([[Image:Report24.png]]) is selected or clicked, ADempiere will check to see if there are any predefined reports.
 
When the report menu or icon ([[Image:Report24.png]]) is selected or clicked, ADempiere will check to see if there are any predefined reports.
Line 85: Line 87:
 
* Exit the Window
 
* Exit the Window
  
We will look at a few of these in detail
+
We will look at a few of these in detail.
  
 
=== Drilling Up, Down and Across ===
 
=== Drilling Up, Down and Across ===
Line 99: Line 101:
 
As an example, open the {{WindowRef|ProductCategory|Product Category}} and click on the Report icon ([[Image:Report24.png]]).  When the report opens, use the [[Lookup]] control (see below) to find all records.  Then, select ''Product'' in the Drill control and double click on any row in the Product Category report.  Another Report Viewer will open showing the Product report listing all products in the Product Category you clicked on.
 
As an example, open the {{WindowRef|ProductCategory|Product Category}} and click on the Report icon ([[Image:Report24.png]]).  When the report opens, use the [[Lookup]] control (see below) to find all records.  Then, select ''Product'' in the Drill control and double click on any row in the Product Category report.  Another Report Viewer will open showing the Product report listing all products in the Product Category you clicked on.
  
Click on the link to the Unit of Measure (UOM) for any product on the list.  A report based on the C_UOM table with the selected C_UOM_ID will appear.  Use the Drill control to find all products that use that UOM by selected ''Product'' in the Drill control and then double clicking anywhere on the record in the UOM report.
+
Click on the link to the Unit of Measure (UOM) for any product on the list.  A report based on the C_UOM table with the selected C_UOM_ID will appear.  Use the Drill control to find all products that use that UOM by selecting ''Product'' in the Drill control and then double clicking anywhere on the record in the UOM report.
 +
 
 +
Try this: find an invoice that has a particular product on one or more of it's invoice lines. 
 +
{{Note|The database is built on one-to-many relationships.  The Drill moves along these relationships.  This makes it difficult to find ALL invoices that order a particular product but easy to find one invoice that does.}}
 +
 
 +
=== Print Format ===
 +
 
 +
The '''Print Format''' combo box displays the current Print Format being displayed.  If additional Print Formats are defined for the same table, they will also be listed here.  Selecting one of them will close the current report and display the selected one. See [[Print Formats]] for more information on creating additional Print Formats.
 +
{{Note|Defining multiple Print Formats for a table is a great way to display information with less clutter.  Set up reports around relevant groupings.}}
  
=== Print Formats ===
 
 
=== Summary ===
 
=== Summary ===
=== Customize Report ===
+
 
 +
The '''Summary''' check box will collapse the report to its main groupings, showing only columns that are set to "group by" or have one of the "Calculate" functions selected in the {{TabRef|PrintFormat|FormatItem|Format Item}} of the {{WindowRef|PrintFormat|Print Format}}.
 +
=== Customizing the Report ===
 +
 
 +
Clicking on the '''Customize Report''' icon ([[Image:Icon_Preference24.png]]) or selecting {{MenuRef|File|Customize Report}} will open the {{WindowRef|PrintFormat|Print Format}}.  Here the format of the report can be modified, the number and placement of the fields controlled, sort orders set and so on.  For more information on how to customize the reports, see [[Print Formats]].
 +
 
 
=== Lookup Record ===
 
=== Lookup Record ===
 +
 +
When the report opens initially, only the current record selected in the window is shown.  The '''Lookup Record''' function ([[Image:Icon_Find24.png]]) can be used to find all or specific records.  The '''Lookup Record''' function works in the same way as it does in the windows.  See [[Lookup]] for more information.
 +
 
=== Page Setup ===
 
=== Page Setup ===
 +
 +
Clicking the '''Page Setup''' icon ([[Image:Icon_PageSetup24.png]]) will open a small dialog similar to the one below where the page source, size, margins and orientation can be changed.  The dialog draws it's information from the printer so the margins may initially reflect the printable area, rather than what was set in the Print Format.  Changing the settings and clicking OK will change the format in the viewer.
 +
{{Space}}
 +
[[Image:PageSetup.png|center|300px]]
 +
{{Space}}
 
=== Send Mail ===
 
=== Send Mail ===
 +
 +
Clicking the Send Mail icon ([[Image:Icon_SendMail24.png]]) will convert the report to PDF format and attach it to a draft e-mail dialog.  You can then send the e-mail to whomever you like.  See the [[EMail]] page for more information.
 +
 
=== Archive Documents ===
 
=== Archive Documents ===
 +
 +
Clicking the '''Archive Reports''' icon ([[Image:Icon_Archive24.png]]) will save a copy of the report in the archive for the table and record that was selected with the Viewer was first opened. More specifically, the report will be archived under the table and record used to open the report.  If you use the drill to move from, say, Business Partners to Invoice, and then archive the Invoice report, it will be archived under the Business Partner used to open the report.  For more information see the [[Archive]] page.
 +
 
=== Export ===
 
=== Export ===
 +
 +
Clicking the '''Export''' button ([[Image:Icon_Export24.png]]) will open a save dialog where you can save the report to disk as an XLS file.  The saved file will then be opened in the appropriate software. See [[Export]] for more information.
  
 
== For Developers ==
 
== For Developers ==
Line 120: Line 150:
 
** org.compiere.apps.APanel.java
 
** org.compiere.apps.APanel.java
 
** org.compiere.print.AReport.java
 
** org.compiere.print.AReport.java
 +
** org.compiere.print.CPaper.java
 +
** org.compiere.print.LayoutEngine.java
 
** org.compiere.print.ReportCtl.java
 
** org.compiere.print.ReportCtl.java
 
** org.compiere.print.ReportViewerProvider.java
 
** org.compiere.print.ReportViewerProvider.java
 
** org.compiere.print.SwingViewerProvider.java
 
** org.compiere.print.SwingViewerProvider.java
 
** org.compiere.print.Viewer.java
 
** org.compiere.print.Viewer.java

Latest revision as of 18:27, 29 January 2012

Table of Contents{{#if: Functionality| | Functionality }}{{#if: | | [[{{{3}}}]] }}{{#if: | | [[{{{4}}}]] }}{{#if: | | [[{{{5}}}]] }} | Report{{#if: Request| | Request }} ⇒

The Report function provides a way to generate simple reports based on the data being viewed.

Access

Icon: Report24.png
Menu: →Report }}{{#if: | → }}{{#if: | → }}
Short Cut: <F11>

Restrictions

To enable reports, the user's role must have Can Report checked in the {{#if: |{{{2}}}|Role }} Window.

To Export the reports, the user's role must have Can Export checked in the {{#if: |{{{2}}}|Role }} Window.

The Report function is only available when viewing a data window.

Description

The Report function will display reports on the current records and table. The format of the report is determined by Print Formats, several of which can be defined for any table.

It is possible to modify the report formats and add others so that there is a choice of what you want to see when you click the report button. For more information on the possibilities, see Print Formats.

It is also possible to override the internal report mechanism and create the reports with Jasper Reports. See Jasper Reports Integration for more information.

When the report menu or icon (Report24.png) is selected or clicked, ADempiere will check to see if there are any predefined reports.

If there are no pre-defined reports, ADempiere will create one using the name of the table. This default print format will use a standard header and will display all available fields in a flat format, one line per row. This will often result in a report that is many pages wide - not very useful, but its a start.

If only one report is defined, it will be displayed immediately. If there are more than one, a small pop-up dialog will appear next to the Report icon in the tool bar, as shown below, with a list of all the defined reports. Clicking on one of the items in the list will open the selected report.

 

Report Popup.png

 

ADempiere will determine if the report is a Jasper Report or a standard report and will display the report accordingly. For more on Jasper Reports, see the Jasper Report documentation. The rest of this article refers to the standard report.

The Report Viewer

The Report Viewer appears as shown below.

 

ReportExample.png

 

The Viewer has the following main components:

  • a title bar
  • a main menu (File, View, Go, ...)
  • a tool bar with several controls
  • the report window
  • a status bar at the bottom and
  • a page count

The title bar and main menu are pretty standard with the following additions:

  • File
    • Customize Report
    • Translate
    • Lookup Record
  • Go
    • First Page
    • Previous Page
    • Next Page
    • Last Page

The tool bar contains the following controls:

  • Previous Page
  • Go To Page
  • Next Page
  • Zoom
  • Drill (by table)
  • Print Formats
  • Summary check box
  • Customize Report
  • Lookup Record
  • Print
  • Page Setup
  • Send mail
  • Archive documents
  • Export
  • Exit the Window

We will look at a few of these in detail.

Drilling Up, Down and Across

The Report Viewer provides the ability to drill down into details, across to related reports and up to more general information.

Each _ID field in the report will appear as a link to the default report for the associated table. Double-clicking the link will open that report.

The Drill Control is a combo box style control with a list of tables that use the main key field of the report being viewed. For example, if viewing the Business Partner report, the key field will be C_BPartner_ID. The Drill Control will contain a list of all tables that include C_BPartner_ID as a column.

Selecting any entry in the Drill control will enable the drill. Then, double clicking on any record in the current report will open the report based on that record. You can click anywhere in the record.

As an example, open the {{#if: Product Category|Product Category|ProductCategory }} Window and click on the Report icon (Report24.png). When the report opens, use the Lookup control (see below) to find all records. Then, select Product in the Drill control and double click on any row in the Product Category report. Another Report Viewer will open showing the Product report listing all products in the Product Category you clicked on.

Click on the link to the Unit of Measure (UOM) for any product on the list. A report based on the C_UOM table with the selected C_UOM_ID will appear. Use the Drill control to find all products that use that UOM by selecting Product in the Drill control and then double clicking anywhere on the record in the UOM report.

Try this: find an invoice that has a particular product on one or more of it's invoice lines.

Note.gif Note:

The database is built on one-to-many relationships. The Drill moves along these relationships. This makes it difficult to find ALL invoices that order a particular product but easy to find one invoice that does.

Print Format

The Print Format combo box displays the current Print Format being displayed. If additional Print Formats are defined for the same table, they will also be listed here. Selecting one of them will close the current report and display the selected one. See Print Formats for more information on creating additional Print Formats.

Note.gif Note:

Defining multiple Print Formats for a table is a great way to display information with less clutter. Set up reports around relevant groupings.

Summary

The Summary check box will collapse the report to its main groupings, showing only columns that are set to "group by" or have one of the "Calculate" functions selected in the {{#if: Format Item|Format Item|FormatItem }} Tab of the {{#if: Print Format|Print Format|PrintFormat }} Window.

Customizing the Report

Clicking on the Customize Report icon (Icon Preference24.png) or selecting File{{#if: Customize Report | →Customize Report }}{{#if: | → }}{{#if: | → }} will open the {{#if: Print Format|Print Format|PrintFormat }} Window. Here the format of the report can be modified, the number and placement of the fields controlled, sort orders set and so on. For more information on how to customize the reports, see Print Formats.

Lookup Record

When the report opens initially, only the current record selected in the window is shown. The Lookup Record function (Icon Find24.png) can be used to find all or specific records. The Lookup Record function works in the same way as it does in the windows. See Lookup for more information.

Page Setup

Clicking the Page Setup icon (Icon PageSetup24.png) will open a small dialog similar to the one below where the page source, size, margins and orientation can be changed. The dialog draws it's information from the printer so the margins may initially reflect the printable area, rather than what was set in the Print Format. Changing the settings and clicking OK will change the format in the viewer.

 

PageSetup.png

 

Send Mail

Clicking the Send Mail icon (Icon SendMail24.png) will convert the report to PDF format and attach it to a draft e-mail dialog. You can then send the e-mail to whomever you like. See the EMail page for more information.

Archive Documents

Clicking the Archive Reports icon (Icon Archive24.png) will save a copy of the report in the archive for the table and record that was selected with the Viewer was first opened. More specifically, the report will be archived under the table and record used to open the report. If you use the drill to move from, say, Business Partners to Invoice, and then archive the Invoice report, it will be archived under the Business Partner used to open the report. For more information see the Archive page.

Export

Clicking the Export button (Icon Export24.png) will open a save dialog where you can save the report to disk as an XLS file. The saved file will then be opened in the appropriate software. See Export for more information.

For Developers

The software that controls this dialog is found in

  • base/src
    • org.compiere.print.ReportEngine.java
  • client/src
    • org.compiere.apps.APanel.java
    • org.compiere.print.AReport.java
    • org.compiere.print.CPaper.java
    • org.compiere.print.LayoutEngine.java
    • org.compiere.print.ReportCtl.java
    • org.compiere.print.ReportViewerProvider.java
    • org.compiere.print.SwingViewerProvider.java
    • org.compiere.print.Viewer.java