Basic Reporting with iDempiere

Level: Beginner Module: General Foundation 15 min read Lesson 11 of 47

Overview

  • What you’ll learn: How to generate and customize reports in iDempiere using print formats, report views, and JasperReports, including built-in financial reports, export options, and report scheduling.
  • Prerequisites: Lesson 1 (Introduction to iDempiere), Lesson 3 (Navigating the Interface), Lesson 7 (Chart of Accounts Setup), Lesson 10 (Document Processing Basics)
  • Estimated reading time: 20 minutes

Introduction

Data in an ERP system is only valuable if you can extract it as meaningful information. iDempiere provides a robust reporting framework that ranges from simple, configuration-driven print formats to powerful, design-rich JasperReports. Whether you need a quick list of open invoices, a detailed financial statement, or a beautifully formatted customer invoice to send by email, iDempiere’s reporting tools have you covered.

This lesson introduces the three primary reporting mechanisms in iDempiere, walks you through creating a simple report step by step, surveys the built-in financial reports, and explains how to export and schedule reports for routine business needs.

Types of Reports in iDempiere

iDempiere offers three distinct approaches to reporting, each suited to different use cases:

1. Print Formats (AD_PrintFormat)

Print formats are the native, built-in reporting mechanism of iDempiere. They are entirely configuration-driven — no coding or external tools required. A print format defines how data from a specific table (or view) is laid out for printing or on-screen display. Every window in iDempiere has a default print format that controls what appears when you click the Print or Report button.

Print formats are best suited for:

  • Standard transactional documents (invoices, orders, shipments, receipts)
  • Simple tabular listings (product lists, business partner directories)
  • Quick, ad-hoc reports that administrators can build without developer tools

The key advantage of print formats is accessibility — any administrator can create and modify them directly within the iDempiere interface. The trade-off is limited formatting flexibility compared to JasperReports.

2. Report Views (AD_ReportView)

Report views provide a data aggregation layer that sits between the raw database tables and the print format presentation. A report view defines a SQL-based data source — typically joining multiple tables and including computed columns — that can then be rendered by a print format.

Report views are used when:

  • You need to aggregate or summarize data across multiple tables
  • The standard table structure does not provide the columns you need
  • You want to create reports with grouping, subtotals, or cross-table calculations

Think of a report view as a “virtual table” that gives the print format access to exactly the data it needs. For example, a sales analysis report might need data from orders, order lines, business partners, and products — a report view joins these tables and presents them as a single data source.

3. JasperReports

JasperReports is a widely-used open-source reporting engine that iDempiere integrates through a plugin. JasperReports provides pixel-perfect report design with advanced features including:

  • Sophisticated visual layouts with precise positioning
  • Charts, graphs, and barcodes embedded directly in reports
  • Sub-reports for master-detail presentations
  • Conditional formatting and complex expressions
  • Cross-tabs (pivot table-style reports)

JasperReports are designed using external tools such as Jaspersoft Studio (an Eclipse-based visual report designer) and then deployed to iDempiere as .jrxml or compiled .jasper files. This approach requires more technical skill than print formats but delivers professional-grade output suitable for customer-facing documents and executive dashboards.

Working with Print Formats

Print Format Structure

A print format record (AD_PrintFormat) contains the following key elements:

  • Name: A descriptive name for the print format (e.g., “Standard Invoice,” “Product Listing by Category”).
  • Table: The database table (or report view) that serves as the data source. All available columns come from this source.
  • Report View: Optionally, a report view that replaces the direct table as the data source.
  • Is Form: When checked, the print format renders as a form (one record per page, like an invoice). When unchecked, it renders as a list (multiple records per page, like a report).
  • Is Default: Whether this is the default print format for the associated table.
  • Header/Footer Margin: Page layout settings.

Print Format Items (Columns)

The real work of a print format happens in its items (stored in AD_PrintFormatItem). Each item represents one element on the report — typically a column from the data source. For each item, you configure:

  • Name: The column header or label displayed on the report.
  • Print Area Type: Where the item appears — Content (the main body), Header, or Footer.
  • Sequence: The display order of the column (left to right for lists, or positional for forms).
  • Is Printed: Whether this item actually appears on the output. Unprinted items can still be used for sorting or grouping.
  • Is Order By: Whether to sort the report by this column. Multiple columns can be marked for sorting, with the sequence determining the sort priority.
  • Sort Order (Ascending/Descending): The direction of the sort.
  • Is Group By: Whether to group records by this column’s value, creating section breaks in the report.
  • Is Sum: Whether to display a running total or sum for numeric columns, useful for financial reports.
  • Is Count: Whether to display a count of records.
  • Display Logic: A conditional expression that controls whether the item appears based on runtime context variables. For example, you might show a “Discount” column only when discounts exist.
  • Max Width/Height: Size constraints for the column.
  • Format Pattern: Number or date formatting pattern (e.g., #,##0.00 for numbers with two decimal places).

Creating a Simple Print Format: Step by Step

Let us walk through creating a simple report that lists all products with their categories and prices:

  1. Navigate to Print Format: Go to System Admin → General Rules → Print Format.
  2. Create a New Record: Click the New button. Enter a name such as “Product Price Report.” Select M_Product as the Table.
  3. Save the Header: Save the record. iDempiere will automatically generate print format items for all columns in the selected table.
  4. Configure the Items: Navigate to the Print Format Item tab. You will see entries for every column in the M_Product table. For most columns, uncheck “Is Printed” — you only want to display a few fields. Enable printing for:
    • Search Key (Value): Sequence 10, Is Printed = Yes, Is Order By = Yes (Ascending).
    • Name: Sequence 20, Is Printed = Yes.
    • Product Category (M_Product_Category_ID): Sequence 30, Is Printed = Yes, Is Group By = Yes (to group products by category).
    • UOM (C_UOM_ID): Sequence 40, Is Printed = Yes.
    • Product Type: Sequence 50, Is Printed = Yes.
  5. Test the Report: Open the Product window, and from the toolbar select Print/Report using your new print format. You can switch between print formats using the print format dropdown if multiple formats exist for the same table.

This example produces a basic listing. For a price-inclusive report, you would base the print format on a report view that joins M_Product with M_ProductPrice to include price columns.

Report Views for Advanced Data

Creating and Using Report Views

A Report View (AD_ReportView) defines the data source for more complex reports. The key fields are:

  • Name: A descriptive name.
  • Table: The primary table for the view.
  • Where Clause: An optional SQL WHERE clause to filter records (e.g., IsActive='Y').
  • Order By Clause: An optional SQL ORDER BY clause.

Report views can reference database views (created by DBAs) that join multiple tables. For instance, you might create a database view called RV_OrderSummary that joins C_Order, C_OrderLine, C_BPartner, and M_Product, then create a report view pointing to this database view, and finally build a print format on top of it.

Drill-Down Capabilities

One of the most powerful features of iDempiere’s reporting system is drill-down. When viewing a report on screen (in HTML mode), you can click on linked values to navigate to the underlying records. For example, in an invoice listing report, clicking on an invoice’s Document No will open the actual invoice record. Drill-down works automatically for foreign key columns — any column that references another table becomes a clickable link.

This capability turns reports from static output into interactive navigation tools, allowing users to move from summary data to transaction detail with a single click.

Introduction to JasperReports in iDempiere

What Are JasperReports?

JasperReports is an open-source Java reporting library that has become the de facto standard for report generation in Java-based applications. Reports are designed as XML template files (.jrxml) that define the layout, data fields, grouping, formatting, and expressions. These templates are compiled into .jasper files that the report engine processes at runtime, combining the template with live data to produce the final output.

How JasperReports Integrate with iDempiere

The integration works through the iDempiere process framework:

  1. Report Design: A developer or report designer creates the report template in Jaspersoft Studio, defining the SQL query (or using a data source provided by iDempiere), the layout bands (title, page header, column header, detail, group header/footer, page footer, summary), and all visual elements.
  2. Deployment: The .jrxml file (or compiled .jasper file) is placed in the iDempiere server’s file system, or attached to a process record, or stored in a report format record.
  3. Process Configuration: In the Application Dictionary, a Process record (AD_Process) is configured to point to the JasperReport file. Parameters defined on the process record become the report’s input parameters (e.g., date range, business partner filter).
  4. Execution: When a user runs the process (from the menu, toolbar, or a window button), iDempiere passes the parameters to the Jasper engine, which executes the report’s query, populates the template, and returns the rendered output.

Many community-contributed and commercial iDempiere plugins include JasperReport templates for standard documents (invoices, purchase orders, delivery notes, checks). These can serve as starting points for your customizations.

When to Use JasperReports vs. Print Formats

Use print formats when:

  • You need a quick report with minimal formatting requirements
  • You want non-technical users to be able to create and modify reports
  • The report is a simple list or form based on a single table or view

Use JasperReports when:

  • You need precise visual control over the output (pixel-perfect layout)
  • The report includes charts, barcodes, or complex visual elements
  • You need sub-reports (e.g., an invoice with line items as a sub-report)
  • The report will be sent to customers or external stakeholders and must look professional
  • You need cross-tab (pivot) reports or complex conditional formatting

Built-In Financial Reports

iDempiere ships with several essential financial reports that draw data from the Fact_Acct table (the general ledger). These are accessible from the Performance Analysis or Financial Reports menu:

Balance Sheet

Presents the organization’s financial position at a point in time, showing Assets, Liabilities, and Equity. The report is driven by the Financial Report configuration, which defines row sets (account groups) and column sets (period definitions). The Balance Sheet uses accounts marked with the Account Type of Asset (A), Liability (L), and Owner’s Equity (O).

Profit and Loss Statement (Income Statement)

Shows revenue, expenses, and net income over a period. It uses Revenue (R) and Expense (E) account types. The P&L report helps you understand whether the business is profitable and where the money is going.

Trial Balance

Lists all accounts with their debit and credit balances for a given period. The total debits must equal total credits (hence “trial”). This report is a fundamental auditing tool used to verify that the books are in balance before producing the Balance Sheet and P&L.

Aging Report

Analyzes outstanding receivables or payables by age — how long invoices have been unpaid. Typical aging buckets are Current, 1-30 days, 31-60 days, 61-90 days, and over 90 days. This report is critical for cash flow management and collections prioritization.

Other Standard Reports

Additional built-in reports include:

  • General Ledger: Detailed journal entry listing for specific accounts or periods.
  • Transaction Detail: Shows every transaction for a selected business partner, product, or account.
  • Open Items: Lists all unpaid invoices and unallocated payments.
  • Inventory Valuation: Shows the current value of inventory by product, warehouse, or category.

Export Formats

Reports in iDempiere can be exported in multiple formats to suit different consumption needs:

  • PDF: The standard format for distributable, print-ready reports. PDFs preserve exact formatting and are universally readable. This is the default output format for JasperReports and the most common format for emailing documents to customers and vendors.
  • Excel (XLS/XLSX): Exports report data into a spreadsheet format. This is invaluable when users need to perform additional analysis, create pivot tables, or manipulate the data. Print format reports export cleanly to Excel with column headers intact.
  • HTML: The default on-screen viewing format. HTML reports support drill-down navigation and are ideal for interactive use within the iDempiere web interface.
  • CSV: A plain-text, comma-separated format suitable for data exchange with external systems, bulk data analysis, or import into other applications.
  • XML: Available for JasperReports, providing structured data output for system integrations.

The export format can typically be selected at the time of report generation. For print formats, the Report button in the toolbar generates HTML by default, with export options available from the report viewer. For JasperReports, the output format may be configured in the process definition or selected by the user at runtime.

Report Parameters and Filtering

Effective reports allow users to focus on the data they need through parameters and filters:

  • Process Parameters: Reports configured as processes can define input parameters — date ranges, business partner selections, product category filters, document status filters, and more. These parameters are presented to the user in a dialog before the report runs and are passed to the report query to filter results.
  • Print Format Filters: When viewing a print format report, users can apply column-level filters directly in the report viewer. Click on a column header to sort, or use the filter row to restrict results (e.g., show only products where Category = “Finished Goods”).
  • Smart Browse Reports: iDempiere also offers Smart Browse, a tool for creating interactive, filterable reports with selection capabilities. Smart Browses combine a report view with user-definable filter criteria and can even trigger batch processing on selected records.

Scheduling Reports

For reports that need to run on a recurring basis, iDempiere provides a scheduling mechanism through the Scheduler window (AD_Scheduler):

  • Schedule Definition: Specify the frequency — daily, weekly, monthly, or a custom cron expression.
  • Process Assignment: Select the report process to run.
  • Parameter Values: Pre-define the parameter values for the scheduled run (e.g., always run for “last month” using relative date expressions).
  • Notification: Configure email recipients who should receive the report output automatically. The report is generated as a PDF or Excel attachment and emailed on schedule.

Scheduling is particularly useful for daily sales summaries, weekly inventory status reports, monthly financial statements, and aging reports sent to the collections team every Monday. By automating report delivery, you ensure that stakeholders always have up-to-date information without manual effort.

Key Takeaways

  • iDempiere offers three reporting mechanisms: Print Formats (configuration-driven, built-in), Report Views (data aggregation layer), and JasperReports (advanced, design-rich external templates).
  • Print formats are the easiest to create and modify — ideal for simple lists and standard documents. They are defined through the AD_PrintFormat and AD_PrintFormatItem tables.
  • Report views join multiple tables into a single data source, enabling more complex reports while still using the print format rendering engine.
  • JasperReports provide pixel-perfect output with charts, sub-reports, and advanced formatting — best for customer-facing documents and executive reports.
  • Built-in financial reports (Balance Sheet, P&L, Trial Balance, Aging) draw from the Fact_Acct table and are essential for financial management.
  • Reports can be exported to PDF, Excel, HTML, CSV, and XML to support different use cases from printing to data analysis.
  • The Scheduler automates recurring reports, delivering them by email on a defined schedule.
  • Drill-down capability transforms on-screen reports into interactive navigation tools, linking summary data to underlying transactions.

What’s Next

In Lesson 12, you will learn about User Roles and Security — how to configure role-based access control so that each user sees only the windows, processes, and data they are authorized to access. Security is the final foundational topic before you move on to intermediate iDempiere operations.

繁體中文

概述

  • 您將學到:如何使用列印格式、報表視圖和 JasperReports 在 iDempiere 中生成和自訂報表,包括內建財務報表、匯出選項和報表排程。
  • 先修課程:第 1 課(iDempiere 簡介)、第 3 課(介面導覽)、第 7 課(會計科目表設定)、第 10 課(單據處理基礎)
  • 預估閱讀時間:20 分鐘

簡介

ERP 系統中的資料只有在您能將其提取為有意義的資訊時才具有價值。iDempiere 提供了一個強大的報表框架,從簡單的、以組態驅動的列印格式到功能豐富的 JasperReports,應有盡有。無論您需要一份未結發票的快速清單、一份詳細的財務報表,還是一份格式精美的客戶發票以便透過電子郵件發送,iDempiere 的報表工具都能滿足您的需求。

本課程介紹 iDempiere 中三種主要的報表機制,逐步引導您建立一份簡單的報表,概述內建的財務報表,並說明如何匯出和排程報表以滿足日常業務需求。

iDempiere 中的報表類型

iDempiere 提供三種不同的報表方式,各自適用於不同的使用情境:

1. 列印格式(AD_PrintFormat)

列印格式是 iDempiere 內建的原生報表機制。它們完全透過組態驅動——不需要編寫程式碼或使用外部工具。列印格式定義了特定資料表(或視圖)的資料如何排版用於列印或螢幕顯示。iDempiere 中的每個視窗都有一個預設的列印格式,用於控制您點擊「列印」或「報表」按鈕時顯示的內容。

列印格式最適合用於:

  • 標準交易單據(發票、訂單、出貨單、收據)
  • 簡單的表格列表(產品清單、業務夥伴目錄)
  • 管理員無需開發工具即可建立的快速即席報表

列印格式的主要優勢在於易用性——任何管理員都可以直接在 iDempiere 介面中建立和修改它們。代價是與 JasperReports 相比,格式化的靈活性較為有限。

2. 報表視圖(AD_ReportView)

報表視圖提供一個資料匯總層,位於原始資料庫表和列印格式展示之間。報表視圖定義了一個基於 SQL 的資料來源——通常連接多個資料表並包含計算欄位——然後可以由列印格式來呈現。

報表視圖適用於以下情況:

  • 您需要跨多個資料表匯總或彙總資料
  • 標準的資料表結構無法提供您需要的欄位
  • 您想要建立具有分組、小計或跨表計算的報表

可以將報表視圖想像成一個「虛擬資料表」,它讓列印格式恰好能存取所需的資料。例如,一份銷售分析報表可能需要來自訂單、訂單明細、業務夥伴和產品的資料——報表視圖將這些資料表連接起來,並以單一資料來源的形式呈現。

3. JasperReports

JasperReports 是一個廣泛使用的開源報表引擎,iDempiere 透過 Plugin 與其整合。JasperReports 提供像素級精確的報表設計,具備以下進階功能:

  • 精密的視覺排版與精確定位
  • 直接嵌入報表中的圖表、圖形和條碼
  • 用於主從式展示的子報表
  • 條件式格式化和複雜運算式
  • 交叉表(樞紐分析表式報表)

JasperReports 使用外部工具設計,例如 Jaspersoft Studio(基於 Eclipse 的視覺化報表設計器),然後以 .jrxml 或已編譯的 .jasper 檔案部署到 iDempiere。這種方式比列印格式需要更多的技術能力,但能夠產出專業級的輸出結果,適用於面向客戶的文件和高階管理儀表板。

使用列印格式

列印格式結構

列印格式記錄(AD_PrintFormat)包含以下關鍵元素:

  • 名稱:列印格式的描述性名稱(例如「標準發票」、「按類別的產品清單」)。
  • 資料表:作為資料來源的資料庫表(或報表視圖)。所有可用欄位均來自此來源。
  • 報表視圖:可選的報表視圖,用以替代直接的資料表作為資料來源。
  • 是否為表單:勾選時,列印格式以表單形式呈現(每頁一筆記錄,如發票)。未勾選時,以列表形式呈現(每頁多筆記錄,如報表)。
  • 是否為預設:是否為相關資料表的預設列印格式。
  • 頁首/頁尾邊距:頁面排版設定。

列印格式項目(欄位)

列印格式的實際運作發生在其項目中(儲存在 AD_PrintFormatItem)。每個項目代表報表上的一個元素——通常是資料來源中的一個欄位。對於每個項目,您需要設定:

  • 名稱:顯示在報表上的欄位標題或標籤。
  • 列印區域類型:項目出現的位置——內容(主體)、頁首或頁尾。
  • 順序:欄位的顯示順序(列表從左到右,或表單的定位)。
  • 是否列印:此項目是否實際出現在輸出中。未列印的項目仍可用於排序或分組。
  • 是否排序:是否依此欄位排序報表。可以標記多個欄位進行排序,順序決定排序優先級。
  • 排序順序(升序/降序):排序的方向。
  • 是否分組:是否依此欄位的值分組記錄,在報表中建立分節。
  • 是否加總:是否顯示數值欄位的累計或合計,適用於財務報表。
  • 是否計數:是否顯示記錄數量。
  • 顯示邏輯:一個條件運算式,根據執行時期的環境變數控制項目是否顯示。例如,您可能僅在存在折扣時才顯示「折扣」欄位。
  • 最大寬度/高度:欄位的大小限制。
  • 格式樣式:數字或日期格式化樣式(例如 #,##0.00 表示帶兩位小數的數字)。

建立簡單列印格式:逐步指南

讓我們逐步建立一份列出所有產品及其類別和價格的簡單報表:

  1. 導覽至列印格式:前往系統管理 → 一般規則 → 列印格式
  2. 建立新記錄:點擊「新增」按鈕。輸入名稱,例如「產品價格報表」。選擇 M_Product 作為資料表。
  3. 儲存表頭:儲存記錄。iDempiere 將自動為所選資料表中的所有欄位生成列印格式項目。
  4. 設定項目:導覽至「列印格式項目」頁籤。您將看到 M_Product 資料表中每個欄位的條目。對於大多數欄位,取消勾選「是否列印」——您只需要顯示少數幾個欄位。啟用以下欄位的列印:
    • 搜尋鍵(Value):順序 10,是否列印 = 是,是否排序 = 是(升序)。
    • 名稱:順序 20,是否列印 = 是。
    • 產品類別(M_Product_Category_ID):順序 30,是否列印 = 是,是否分組 = 是(按類別分組產品)。
    • 計量單位(C_UOM_ID):順序 40,是否列印 = 是。
    • 產品類型:順序 50,是否列印 = 是。
  5. 測試報表:開啟「產品」視窗,從工具列選擇使用新列印格式的「列印/報表」。如果同一資料表存在多個格式,您可以使用列印格式下拉選單切換。

此範例產生一份基本清單。若要包含價格的報表,您需要將列印格式基於連接 M_Product 和 M_ProductPrice 的報表視圖,以包含價格欄位。

進階資料的報表視圖

建立和使用報表視圖

報表視圖(AD_ReportView)定義了更複雜報表的資料來源。關鍵欄位包括:

  • 名稱:描述性名稱。
  • 資料表:視圖的主要資料表。
  • Where 子句:可選的 SQL WHERE 子句,用於篩選記錄(例如 IsActive='Y')。
  • Order By 子句:可選的 SQL ORDER BY 子句。

報表視圖可以參照由資料庫管理員建立的資料庫視圖,這些視圖連接了多個資料表。例如,您可以建立一個名為 RV_OrderSummary 的資料庫視圖,連接 C_OrderC_OrderLineC_BPartnerM_Product,然後建立一個指向此資料庫視圖的報表視圖,最後在其上建立列印格式。

鑽取功能

iDempiere 報表系統最強大的功能之一是鑽取(Drill-Down)。在螢幕上檢視報表時(HTML 模式),您可以點擊連結的值以導覽至底層記錄。例如,在發票清單報表中,點擊發票的單據編號將開啟實際的發票記錄。鑽取功能會自動適用於外來鍵欄位——任何參照其他資料表的欄位都會成為可點擊的連結。

此功能將報表從靜態輸出轉變為互動式導覽工具,使用者只需一次點擊即可從摘要資料導覽至交易明細。

iDempiere 中的 JasperReports 簡介

什麼是 JasperReports?

JasperReports 是一個開源的 Java 報表庫,已成為 Java 應用程式中報表生成的事實標準。報表設計為 XML 範本檔案(.jrxml),定義了版面配置、資料欄位、分組、格式化和運算式。這些範本被編譯為 .jasper 檔案,報表引擎在執行時期處理這些檔案,將範本與即時資料結合以產生最終輸出。

JasperReports 如何與 iDempiere 整合

整合透過 iDempiere 的流程框架運作:

  1. 報表設計:開發人員或報表設計師在 Jaspersoft Studio 中建立報表範本,定義 SQL 查詢(或使用 iDempiere 提供的資料來源)、版面配置區段(標題、頁首、欄位標題、明細、群組頁首/頁尾、頁尾、摘要)以及所有視覺元素。
  2. 部署:.jrxml 檔案(或已編譯的 .jasper 檔案)放置在 iDempiere 伺服器的檔案系統中,或附加到流程記錄,或儲存在報表格式記錄中。
  3. 流程設定:在 Application Dictionary 中,設定一個 Process 記錄(AD_Process)以指向 JasperReport 檔案。在流程記錄上定義的參數將成為報表的輸入參數(例如日期範圍、業務夥伴篩選條件)。
  4. 執行:當使用者執行流程時(從選單、工具列或視窗按鈕),iDempiere 將參數傳遞給 Jasper 引擎,引擎執行報表的查詢、填充範本並回傳呈現的輸出結果。

許多社群貢獻和商業的 iDempiere Plugin 包含標準文件的 JasperReport 範本(發票、採購訂單、交貨通知、支票)。這些可以作為您自訂的起點。

何時使用 JasperReports 與列印格式

在以下情況使用列印格式

  • 您需要一份格式要求最少的快速報表
  • 您希望非技術使用者能夠建立和修改報表
  • 報表是基於單一資料表或視圖的簡單清單或表單

在以下情況使用 JasperReports

  • 您需要精確的視覺控制(像素級精確排版)
  • 報表包含圖表、條碼或複雜的視覺元素
  • 您需要子報表(例如包含明細行的發票子報表)
  • 報表將發送給客戶或外部利害關係人,必須看起來專業
  • 您需要交叉表(樞紐分析)報表或複雜的條件式格式化

內建財務報表

iDempiere 附帶多份重要的財務報表,這些報表從 Fact_Acct 資料表(總帳)中提取資料。可以從績效分析財務報表選單存取:

資產負債表

呈現組織在特定時間點的財務狀況,顯示資產、負債和權益。此報表由財務報表設定驅動,該設定定義了列集(科目群組)和欄集(期間定義)。資產負債表使用標記為資產(A)、負債(L)和業主權益(O)科目類型的科目。

損益表(收益表)

顯示一段期間內的收入、費用和淨利。它使用收入(R)和費用(E)科目類型。損益表幫助您了解企業是否獲利以及資金的流向。

試算表

列出特定期間所有科目及其借方和貸方餘額。借方總額必須等於貸方總額(因此稱為「試算」)。此報表是一項基本的稽核工具,用於在產生資產負債表和損益表之前驗證帳目是否平衡。

帳齡分析報表

按帳齡分析未結的應收帳款或應付帳款——即發票未付款的時間長度。典型的帳齡區間包括:當期、1-30 天、31-60 天、61-90 天及超過 90 天。此報表對於現金流管理和催收優先順序至關重要。

其他標準報表

其他內建報表包括:

  • 總帳:特定科目或期間的詳細分錄列表。
  • 交易明細:顯示所選業務夥伴、產品或科目的每筆交易。
  • 未結項目:列出所有未付發票和未分配的付款。
  • 庫存估值:按產品、倉庫或類別顯示當前的庫存價值。

匯出格式

iDempiere 中的報表可以匯出為多種格式,以滿足不同的使用需求:

  • PDF:可分發的、可列印報表的標準格式。PDF 保留精確的格式,且具有通用的可讀性。這是 JasperReports 的預設輸出格式,也是透過電子郵件向客戶和供應商發送文件的最常用格式。
  • Excel(XLS/XLSX):將報表資料匯出為試算表格式。當使用者需要進行額外分析、建立樞紐分析表或操作資料時,這非常有價值。列印格式報表可以完整匯出至 Excel,欄位標題保持不變。
  • HTML:預設的螢幕檢視格式。HTML 報表支援鑽取導覽,非常適合在 iDempiere Web 介面中進行互動使用。
  • CSV:純文字、以逗號分隔的格式,適用於與外部系統的資料交換、大量資料分析或匯入其他應用程式。
  • XML:適用於 JasperReports,提供結構化的資料輸出以用於系統整合。

匯出格式通常可以在報表生成時選擇。對於列印格式,工具列中的「報表」按鈕預設生成 HTML,報表檢視器中提供匯出選項。對於 JasperReports,輸出格式可以在流程定義中設定,或由使用者在執行時選擇。

報表參數和篩選

有效的報表允許使用者透過參數和篩選條件專注於所需的資料:

  • 流程參數:設定為流程的報表可以定義輸入參數——日期範圍、業務夥伴選擇、產品類別篩選、單據狀態篩選等。這些參數在報表執行前以對話方塊的形式呈現給使用者,並傳遞至報表查詢以篩選結果。
  • 列印格式篩選:檢視列印格式報表時,使用者可以直接在報表檢視器中套用欄位級別的篩選條件。點擊欄位標題進行排序,或使用篩選列限制結果(例如,僅顯示類別為「成品」的產品)。
  • Smart Browse 報表:iDempiere 還提供 Smart Browse,這是一個用於建立互動式、可篩選報表的工具,具備選擇功能。Smart Browse 將報表視圖與使用者可定義的篩選條件結合,甚至可以對所選記錄觸發批次處理。

排程報表

對於需要定期執行的報表,iDempiere 透過排程器視窗(AD_Scheduler)提供排程機制:

  • 排程定義:指定頻率——每日、每週、每月或自訂的 cron 運算式。
  • 流程指派:選擇要執行的報表流程。
  • 參數值:預先定義排程執行的參數值(例如,使用相對日期運算式始終執行「上個月」)。
  • 通知:設定應自動接收報表輸出的電子郵件收件人。報表以 PDF 或 Excel 附件的形式生成並按排程發送電子郵件。

排程功能對於每日銷售摘要、每週庫存狀態報表、每月財務報表以及每週一發送給催收團隊的帳齡報表特別有用。透過自動化報表交付,您可以確保利害關係人始終擁有最新的資訊,無需手動操作。

重點摘要

  • iDempiere 提供三種報表機制:列印格式(組態驅動、內建)、報表視圖(資料匯總層)和 JasperReports(進階、設計豐富的外部範本)。
  • 列印格式最容易建立和修改——適合簡單清單和標準文件。它們透過 AD_PrintFormat 和 AD_PrintFormatItem 資料表定義。
  • 報表視圖將多個資料表連接為單一資料來源,使得更複雜的報表仍能使用列印格式呈現引擎。
  • JasperReports 提供像素級精確的輸出,包含圖表、子報表和進階格式化——最適合面向客戶的文件和高階管理報表。
  • 內建財務報表(資產負債表、損益表、試算表、帳齡分析)從 Fact_Acct 資料表提取資料,對於財務管理至關重要。
  • 報表可以匯出為 PDF、Excel、HTML、CSV 和 XML,以支援從列印到資料分析的不同使用情境。
  • 排程器自動化定期報表,按照定義的排程透過電子郵件發送。
  • 鑽取功能將螢幕上的報表轉變為互動式導覽工具,將摘要資料連結至底層交易。

下一步

在第 12 課中,您將學習使用者角色與安全性——如何設定基於角色的存取控制,使每位使用者只能看到其被授權存取的視窗、流程和資料。安全性是您進入中階 iDempiere 操作之前的最後一個基礎主題。

日本語

概要

  • 学習内容:iDempiere で印刷フォーマット、レポートビュー、JasperReports を使用してレポートを生成・カスタマイズする方法。組み込みの財務レポート、エクスポートオプション、レポートスケジューリングを含みます。
  • 前提条件:レッスン 1(iDempiere 入門)、レッスン 3(インターフェースのナビゲーション)、レッスン 7(勘定科目表の設定)、レッスン 10(伝票処理の基本)
  • 推定読了時間:20 分

はじめに

ERP システム内のデータは、有意義な情報として抽出できて初めて価値を持ちます。iDempiere は、シンプルな設定駆動型の印刷フォーマットから、強力でデザイン性の高い JasperReports まで、堅牢なレポーティングフレームワークを提供します。未決済請求書のクイックリスト、詳細な財務諸表、メールで送信するための美しくフォーマットされた顧客請求書が必要な場合でも、iDempiere のレポーティングツールで対応できます。

このレッスンでは、iDempiere の 3 つの主要なレポーティングメカニズムを紹介し、簡単なレポートの作成手順を順を追って説明し、組み込みの財務レポートを概観し、日常業務のニーズに応じたレポートのエクスポートとスケジューリングの方法を解説します。

iDempiere のレポートタイプ

iDempiere は 3 つの異なるレポーティングアプローチを提供しており、それぞれ異なるユースケースに適しています:

1. 印刷フォーマット(AD_PrintFormat)

印刷フォーマットは、iDempiere のネイティブな組み込みレポーティングメカニズムです。完全に設定駆動型であり、コーディングや外部ツールは不要です。印刷フォーマットは、特定のテーブル(またはビュー)のデータが印刷や画面表示のためにどのようにレイアウトされるかを定義します。iDempiere のすべてのウィンドウには、「印刷」または「レポート」ボタンをクリックしたときに表示される内容を制御するデフォルトの印刷フォーマットがあります。

印刷フォーマットは以下に最適です:

  • 標準的な取引伝票(請求書、注文書、出荷伝票、領収書)
  • シンプルな表形式リスト(製品リスト、取引先ディレクトリ)
  • 管理者が開発ツールなしで作成できるクイック・アドホックレポート

印刷フォーマットの主な利点はアクセシビリティです。管理者であれば誰でも iDempiere のインターフェース内で直接作成・修正できます。トレードオフとして、JasperReports と比較してフォーマットの柔軟性が制限されます。

2. レポートビュー(AD_ReportView)

レポートビューは、生のデータベーステーブルと印刷フォーマットの表示の間に位置するデータ集約レイヤーを提供します。レポートビューは SQL ベースのデータソースを定義します。通常、複数のテーブルを結合し、計算列を含みます。これは印刷フォーマットによってレンダリングされます。

レポートビューは以下の場合に使用されます:

  • 複数のテーブルにまたがるデータの集約やサマリーが必要な場合
  • 標準のテーブル構造では必要な列が提供されない場合
  • グルーピング、小計、テーブル間の計算を含むレポートを作成したい場合

レポートビューは、印刷フォーマットが必要なデータに正確にアクセスできるようにする「仮想テーブル」と考えることができます。例えば、売上分析レポートでは、注文、注文明細、取引先、製品のデータが必要になる場合があります。レポートビューはこれらのテーブルを結合し、単一のデータソースとして提示します。

3. JasperReports

JasperReports は広く使用されているオープンソースのレポーティングエンジンであり、iDempiere は Plugin を通じて統合しています。JasperReports は以下の高度な機能を備えた、ピクセルパーフェクトなレポートデザインを提供します:

  • 精密な配置による洗練されたビジュアルレイアウト
  • レポートに直接埋め込まれるチャート、グラフ、バーコード
  • マスター・ディテール表示のためのサブレポート
  • 条件付きフォーマットと複雑な式
  • クロス集計(ピボットテーブル形式のレポート)

JasperReports は Jaspersoft Studio(Eclipse ベースのビジュアルレポートデザイナー)などの外部ツールを使用して設計され、.jrxml またはコンパイル済みの .jasper ファイルとして iDempiere にデプロイされます。このアプローチは印刷フォーマットよりも高い技術スキルを必要としますが、顧客向けドキュメントやエグゼクティブダッシュボードに適したプロフェッショナルグレードの出力を提供します。

印刷フォーマットの操作

印刷フォーマットの構造

印刷フォーマットレコード(AD_PrintFormat)には、以下の主要な要素が含まれます:

  • 名前:印刷フォーマットの説明的な名前(例:「標準請求書」、「カテゴリ別製品リスト」)。
  • テーブル:データソースとなるデータベーステーブル(またはレポートビュー)。利用可能なすべての列はこのソースから取得されます。
  • レポートビュー:オプションで、直接のテーブルに代わるデータソースとしてのレポートビュー。
  • フォーム形式:チェックすると、印刷フォーマットはフォーム形式でレンダリングされます(1 ページ 1 レコード、請求書のように)。チェックしないと、リスト形式でレンダリングされます(1 ページ複数レコード、レポートのように)。
  • デフォルト:関連テーブルのデフォルト印刷フォーマットかどうか。
  • ヘッダー/フッターマージン:ページレイアウト設定。

印刷フォーマット項目(列)

印刷フォーマットの実際の作業は、その項目(AD_PrintFormatItem に格納)で行われます。各項目はレポート上の 1 つの要素を表します。通常、データソースの列です。各項目について以下を設定します:

  • 名前:レポートに表示される列ヘッダーまたはラベル。
  • 印刷エリアタイプ:項目が表示される場所 — コンテンツ(本体)、ヘッダー、またはフッター。
  • 順序:列の表示順序(リストでは左から右、フォームでは位置指定)。
  • 印刷対象:この項目が実際に出力に表示されるかどうか。印刷対象外の項目でも、ソートやグルーピングに使用できます。
  • ソート対象:この列でレポートをソートするかどうか。複数の列をソート対象としてマークでき、順序がソートの優先度を決定します。
  • ソート順序(昇順/降順):ソートの方向。
  • グループ化:この列の値でレコードをグループ化し、レポート内にセクション区切りを作成するかどうか。
  • 合計表示:数値列の累計や合計を表示するかどうか。財務レポートに有用です。
  • 件数表示:レコード数を表示するかどうか。
  • 表示ロジック:ランタイムのコンテキスト変数に基づいて項目の表示を制御する条件式。例えば、割引が存在する場合にのみ「割引」列を表示できます。
  • 最大幅/高さ:列のサイズ制約。
  • フォーマットパターン:数値または日付のフォーマットパターン(例:#,##0.00 は小数点以下 2 桁の数値を表します)。

シンプルな印刷フォーマットの作成:ステップバイステップ

すべての製品をカテゴリと価格とともにリスト表示するシンプルなレポートの作成手順を説明します:

  1. 印刷フォーマットに移動:システム管理 → 一般ルール → 印刷フォーマットに移動します。
  2. 新規レコードの作成:「新規」ボタンをクリックします。「製品価格レポート」などの名前を入力します。テーブルとして M_Product を選択します。
  3. ヘッダーの保存:レコードを保存します。iDempiere は選択したテーブルのすべての列に対して、印刷フォーマット項目を自動的に生成します。
  4. 項目の設定:「印刷フォーマット項目」タブに移動します。M_Product テーブルのすべての列のエントリが表示されます。ほとんどの列で「印刷対象」のチェックを外します。表示したいフィールドは少数のみです。以下の印刷を有効にします:
    • 検索キー(Value):順序 10、印刷対象 = はい、ソート対象 = はい(昇順)。
    • 名前:順序 20、印刷対象 = はい。
    • 製品カテゴリ(M_Product_Category_ID):順序 30、印刷対象 = はい、グループ化 = はい(カテゴリ別に製品をグループ化)。
    • 単位(C_UOM_ID):順序 40、印刷対象 = はい。
    • 製品タイプ:順序 50、印刷対象 = はい。
  5. レポートのテスト:「製品」ウィンドウを開き、ツールバーから新しい印刷フォーマットを使用して「印刷/レポート」を選択します。同じテーブルに複数のフォーマットが存在する場合は、印刷フォーマットのドロップダウンで切り替えることができます。

この例は基本的なリストを生成します。価格を含むレポートの場合は、M_Product と M_ProductPrice を結合するレポートビューに基づいて印刷フォーマットを作成し、価格列を含めます。

高度なデータのためのレポートビュー

レポートビューの作成と使用

レポートビュー(AD_ReportView)は、より複雑なレポートのデータソースを定義します。主要なフィールドは以下の通りです:

  • 名前:説明的な名前。
  • テーブル:ビューの主テーブル。
  • Where 句:レコードをフィルタリングするためのオプションの SQL WHERE 句(例:IsActive='Y')。
  • Order By 句:オプションの SQL ORDER BY 句。

レポートビューは、DBA が作成した複数のテーブルを結合するデータベースビューを参照できます。例えば、C_OrderC_OrderLineC_BPartnerM_Product を結合する RV_OrderSummary というデータベースビューを作成し、このデータベースビューを指すレポートビューを作成し、最後にその上に印刷フォーマットを構築できます。

ドリルダウン機能

iDempiere のレポーティングシステムの最も強力な機能の 1 つはドリルダウンです。画面上でレポートを表示しているとき(HTML モード)、リンクされた値をクリックして基となるレコードに移動できます。例えば、請求書リストレポートで、請求書の伝票番号をクリックすると、実際の請求書レコードが開きます。ドリルダウンは外部キー列に対して自動的に機能します。他のテーブルを参照するすべての列がクリック可能なリンクになります。

この機能により、レポートは静的な出力からインタラクティブなナビゲーションツールに変わり、ユーザーはワンクリックでサマリーデータから取引明細に移動できます。

iDempiere における JasperReports 入門

JasperReports とは?

JasperReports は、Java ベースのアプリケーションにおけるレポート生成のデファクトスタンダードとなったオープンソースの Java レポーティングライブラリです。レポートは XML テンプレートファイル(.jrxml)として設計され、レイアウト、データフィールド、グルーピング、フォーマット、式を定義します。これらのテンプレートは .jasper ファイルにコンパイルされ、レポートエンジンが実行時にテンプレートとライブデータを組み合わせて最終的な出力を生成します。

JasperReports と iDempiere の統合方法

統合は iDempiere のプロセスフレームワークを通じて行われます:

  1. レポート設計:開発者またはレポートデザイナーが Jaspersoft Studio でレポートテンプレートを作成し、SQL クエリ(または iDempiere が提供するデータソース)、レイアウトバンド(タイトル、ページヘッダー、列ヘッダー、詳細、グループヘッダー/フッター、ページフッター、サマリー)、およびすべてのビジュアル要素を定義します。
  2. デプロイ:.jrxml ファイル(またはコンパイル済みの .jasper ファイル)を iDempiere サーバーのファイルシステムに配置するか、プロセスレコードに添付するか、レポートフォーマットレコードに格納します。
  3. プロセス設定:Application Dictionary で、Process レコード(AD_Process)を JasperReport ファイルを指すように設定します。プロセスレコードに定義されたパラメータが、レポートの入力パラメータ(例:日付範囲、取引先フィルター)になります。
  4. 実行:ユーザーがプロセスを実行すると(メニュー、ツールバー、またはウィンドウボタンから)、iDempiere がパラメータを Jasper エンジンに渡し、エンジンがレポートのクエリを実行し、テンプレートにデータを埋め込み、レンダリングされた出力を返します。

多くのコミュニティ貢献および商用の iDempiere Plugin には、標準ドキュメント(請求書、発注書、納品書、小切手)の JasperReport テンプレートが含まれています。これらはカスタマイズの出発点として利用できます。

JasperReports と印刷フォーマットの使い分け

以下の場合は印刷フォーマットを使用します:

  • 最小限のフォーマット要件でクイックレポートが必要な場合
  • 非技術ユーザーがレポートを作成・修正できるようにしたい場合
  • レポートが単一のテーブルまたはビューに基づくシンプルなリストまたはフォームの場合

以下の場合は JasperReports を使用します:

  • 出力の正確なビジュアル制御が必要な場合(ピクセルパーフェクトなレイアウト)
  • レポートにチャート、バーコード、または複雑なビジュアル要素が含まれる場合
  • サブレポートが必要な場合(例:明細行をサブレポートとする請求書)
  • レポートを顧客や外部のステークホルダーに送信し、プロフェッショナルに見える必要がある場合
  • クロス集計(ピボット)レポートや複雑な条件付きフォーマットが必要な場合

組み込み財務レポート

iDempiere には、Fact_Acct テーブル(総勘定元帳)からデータを取得する、いくつかの重要な財務レポートが同梱されています。これらは業績分析または財務レポートメニューからアクセスできます:

貸借対照表

特定時点における組織の財務状態を、資産、負債、純資産で表示します。このレポートは財務レポート設定によって駆動され、行セット(勘定グループ)と列セット(期間定義)を定義します。貸借対照表は、勘定科目タイプが資産(A)、負債(L)、資本(O)としてマークされた勘定科目を使用します。

損益計算書

一定期間の収益、費用、純利益を表示します。収益(R)と費用(E)の勘定科目タイプを使用します。損益計算書は、事業が利益を上げているかどうか、また資金がどこに使われているかを理解するのに役立ちます。

試算表

特定期間のすべての勘定科目とその借方・貸方残高を一覧表示します。借方合計は貸方合計と一致しなければなりません(そのため「試算」と呼ばれます)。このレポートは、貸借対照表と損益計算書を作成する前に帳簿が均衡していることを確認するための基本的な監査ツールです。

滞留分析レポート

未決済の売掛金または買掛金を滞留期間別に分析します。請求書がどのくらいの期間未払いであるかを示します。典型的な滞留区分は、当期、1〜30 日、31〜60 日、61〜90 日、90 日超です。このレポートはキャッシュフロー管理と回収の優先順位付けに不可欠です。

その他の標準レポート

その他の組み込みレポートには以下が含まれます:

  • 総勘定元帳:特定の勘定科目または期間の詳細な仕訳一覧。
  • 取引明細:選択した取引先、製品、または勘定科目のすべての取引を表示。
  • 未決済項目:すべての未払い請求書と未消込の入金を一覧表示。
  • 在庫評価:製品、倉庫、またはカテゴリ別の現在の在庫価値を表示。

エクスポート形式

iDempiere のレポートは、さまざまな利用ニーズに応じて複数の形式でエクスポートできます:

  • PDF:配布可能な印刷対応レポートの標準形式。PDF は正確なフォーマットを保持し、普遍的に読み取り可能です。JasperReports のデフォルト出力形式であり、顧客やベンダーへのメール送信で最も一般的な形式です。
  • Excel(XLS/XLSX):レポートデータをスプレッドシート形式でエクスポートします。追加分析、ピボットテーブルの作成、データの加工が必要な場合に非常に有用です。印刷フォーマットレポートは列ヘッダーを維持したまま Excel にきれいにエクスポートされます。
  • HTML:デフォルトの画面表示形式。HTML レポートはドリルダウンナビゲーションをサポートし、iDempiere Web インターフェース内でのインタラクティブな使用に最適です。
  • CSV:外部システムとのデータ交換、大量データ分析、他のアプリケーションへのインポートに適したプレーンテキストのカンマ区切り形式。
  • XML:JasperReports で利用可能であり、システム統合のための構造化データ出力を提供します。

エクスポート形式は通常、レポート生成時に選択できます。印刷フォーマットの場合、ツールバーの「レポート」ボタンはデフォルトで HTML を生成し、レポートビューアからエクスポートオプションを利用できます。JasperReports の場合、出力形式はプロセス定義で設定するか、ユーザーが実行時に選択できます。

レポートパラメータとフィルタリング

効果的なレポートは、パラメータとフィルターを通じてユーザーが必要なデータに焦点を当てることを可能にします:

  • プロセスパラメータ:プロセスとして設定されたレポートは、入力パラメータを定義できます。日付範囲、取引先の選択、製品カテゴリフィルター、伝票ステータスフィルターなどです。これらのパラメータはレポート実行前にダイアログでユーザーに提示され、レポートクエリに渡されて結果をフィルタリングします。
  • 印刷フォーマットフィルター:印刷フォーマットレポートを表示する際、ユーザーはレポートビューアで列レベルのフィルターを直接適用できます。列ヘッダーをクリックしてソートするか、フィルター行を使用して結果を制限します(例:カテゴリが「完成品」の製品のみ表示)。
  • Smart Browse レポート:iDempiere は Smart Browse も提供しています。これは選択機能を備えたインタラクティブでフィルタリング可能なレポートを作成するためのツールです。Smart Browse はレポートビューとユーザー定義可能なフィルター条件を組み合わせ、選択したレコードに対してバッチ処理をトリガーすることもできます。

レポートのスケジューリング

定期的に実行する必要があるレポートのために、iDempiere はスケジューラウィンドウ(AD_Scheduler)を通じてスケジューリングメカニズムを提供します:

  • スケジュール定義:頻度を指定します — 毎日、毎週、毎月、またはカスタムの cron 式。
  • プロセス割り当て:実行するレポートプロセスを選択します。
  • パラメータ値:スケジュール実行のパラメータ値を事前に定義します(例:相対日付式を使用して常に「先月」を実行)。
  • 通知:レポート出力を自動的に受信するメール受信者を設定します。レポートは PDF または Excel の添付ファイルとして生成され、スケジュールに従ってメール送信されます。

スケジューリングは、日次の売上サマリー、週次の在庫状況レポート、月次の財務諸表、毎週月曜日に回収チームに送信される滞留レポートに特に有用です。レポート配信を自動化することで、手動作業なしにステークホルダーが常に最新の情報を入手できるようにします。

重要ポイント

  • iDempiere は 3 つのレポーティングメカニズムを提供します:印刷フォーマット(設定駆動型、組み込み)、レポートビュー(データ集約レイヤー)、JasperReports(高度でデザイン性の高い外部テンプレート)。
  • 印刷フォーマットは最も作成・修正が容易です。シンプルなリストや標準ドキュメントに最適です。AD_PrintFormat テーブルと AD_PrintFormatItem テーブルで定義されます。
  • レポートビューは複数のテーブルを単一のデータソースに結合し、印刷フォーマットのレンダリングエンジンを使用しながらより複雑なレポートを可能にします。
  • JasperReports はチャート、サブレポート、高度なフォーマットを備えたピクセルパーフェクトな出力を提供します。顧客向けドキュメントやエグゼクティブレポートに最適です。
  • 組み込み財務レポート(貸借対照表、損益計算書、試算表、滞留分析)は Fact_Acct テーブルからデータを取得し、財務管理に不可欠です。
  • レポートは PDF、Excel、HTML、CSV、XML にエクスポートでき、印刷からデータ分析まで異なるユースケースをサポートします。
  • スケジューラは定期的なレポートを自動化し、定義されたスケジュールに従ってメールで配信します。
  • ドリルダウン機能は画面上のレポートをインタラクティブなナビゲーションツールに変え、サマリーデータを基となる取引にリンクします。

次のステップ

レッスン 12 では、ユーザーロールとセキュリティについて学びます。ロールベースのアクセス制御を設定して、各ユーザーがアクセスを許可されたウィンドウ、プロセス、データのみを表示できるようにする方法です。セキュリティは、中級の iDempiere 操作に進む前の最後の基礎トピックです。

You Missed