Write a report using ]po['s Reporting Engine

Package [package-intranet-reporting-tutorial|intranet-reporting-tutorial] contains some sample reports that show the structure of typical ]po[ reports. 
They are a good starting point to get familiar with programming reports. 

Elements of a typical report

SQL

The sql statement defines content and grouping of a report.

Report Definition

 

All report are defined by:

  • group-by clause
  • header definition
  • content definition
  • footer definition

List of all counters

set counters [list \
        $invoice_subsubtotal_counter \
        $delnote_subsubtotal_counter \
        $quote_subsubtotal_counter \
        $bill_subsubtotal_counter \
        $po_subsubtotal_counter \
        $expense_subsubtotal_counter \
        $timesheet_subsubtotal_counter \
        $invoice_subtotal_counter \
        $delnote_subtotal_counter \
        $quote_subtotal_counter \
        $bill_subtotal_counter \
        $po_subtotal_counter \
        $expense_subtotal_counter \
        $timesheet_subtotal_counter \
        $invoice_total_counter \
        $delnote_total_counter \
        $quote_total_counter \
        $bill_total_counter \
        $po_total_counter \
        $expense_total_counter \
        $timesheet_total_counter \
]

Counter definition

Sample:
set quote_subsubtotal_counter [list pretty_name "Quote Amount" var quote_subsubtotal reset \$project_id expr "\$quote_amount+0"]

Principal methods used

im_report_render_header

Renders a single row in a project-open report.The procedure takes a report definition, an array of the "last_values" (from the last row) and the current variables via upvar and writes a report line to the page via ns_write.
Returns an array of the new values for the current row.

im_report_display_footer

Display the footer stack of a single row in a project-open report.

im_report_update_counters

Takes a definition of the report counters and update the counter values according to the variables in the parent frame




  Contact Us
  Project Open Business Solutions S.L.

Calle Aprestadora 19, 12o-2a

E-08907 Hospitalet de Llobregat (Barcelona)

 Tel Europe: +34 932 202 088
 Tel US: +1 415 429 5995
 Mail: info@project-open.com