prerequisite : basic knowledge of Pentaho
Pentaho Reporting offers many capabilities and expressions that can be used all through record advent. A characteristic in Pentaho Reporting is used to calculate a computed value, whilst an expression in Pentaho Reporting is a feature whose scope is constrained to the contemporary dataset row. A feature can also keep nation, gaining access to many rows of information.
capabilities and expressions in document report creation
beginning from the report clothier user interface, capabilities and expressions live in two unique places because their scope is distinctive. features can be determined in report explorer, particularly, in the facts tab below the capabilities institution. the subsequent screenshot indicates how the file explorer seems with functions described:
Simple but mostly used common functions or Document Function
The commonplace class incorporates features that take care of web page numbering, and a popular OpenFormula characteristic that you could use to create your own custom feature.
Function Name | Use of Function |
Open Formula | Enables you to create your own custom OpenFormula function using the built-in Formula Editor. This function will run according to its placement in the report. If you need a custom function to run before all other report actions, use the Open Formula function in the Advanced category instead. |
Page | Counts the number of pages rendered thus far in a report. |
Total Page Count | Lists the total number of pages in the rendered report. |
Page of Pages | Prints the current page number in comparison to the total number of pages in the rendered report. |
Report Functions
The Report category contains functions that modify the layout of the rendered report.
Function Name | Use of Function |
---|---|
Is Export Type | Tests whether the given export type has been selected for this report. |
Row Banding | Alternates the background color of each item band in a group. |
Hide Repeating | Hides equal values in a group. Only the first changed value is printed. |
Summary Functions
The Summary category contains mathematical functions that count, add, and divide report data in groups.
Function Name | Use of Function |
---|---|
Sum | Calculates the sum of the selected numeric column. This produces a global total. |
Count | Counts the total number of items contained in a group. If no group is specified, all items in the entire report are counted. |
Count by Page | Counts the total number of items contained in a group on one rendered page. If no group is specified, all items on the entire page are counted. |
Group Count | Counts the total number of items in the selected groups. If no group is specified, all items in all groups are counted. |
Minimum | Identifies the lowest or smallest value in a group. |
Maximum | Identifies the highest or largest value in a group. |
Running Functions
The Running category contains mathematical functions that deal with running totals, as opposed to global or summary totals.
Function Name | Use of Function |
---|---|
Sum | Calculates a running total sum of the specified column. |
Count | Counts the items in a group or report. |
Average | Calculates the average value in a given column. |
Minimum | Identifies the lowest or smallest value in a column. |
Maximum | Identifies the highest or largest value in a column. |
Percent of Total | Calculates the percentage value of a numeric column. The total sum is divided by the number of items counted. |
Chart Data Functions
The Chart Data category contains functions that create datasets for JFreeChart elements.
Function Name | Use of Function |
---|---|
CategorySet Data Collector | See CategorySet |
Pie DataSet Collector | See PieSet |
Pivoting CategorySet Data Collector | See PivotCategorySet |
TimeSeries Collector | See TimeSeries |
XY-Series Collector | See XYSeries |
XYZ-Series Collector | See XYZSeries |
Script Functions
The Script contains functions that you can directly use in type of code from a supported scripting language like
- Bean-Scripting Framework (BSF)
- Bean-Scripting Host (BSH)
- JavaScript
- Single Value Query
The only unique object Pentaho offers in Report Designer for a scripting language is getValue
for the Bean-Scripting Framework, which retrieves the current record or row, as shown below:
Object getValue() { Object value = dataRow.get("RegionVariance"); if (value instanceof Number == false) { return Boolean.FALSE; } Number number = (Number) value; if (number.doubleValue() < 0) { return Boolean.TRUE; } return Boolean.FALSE; }
Deprecated Functions
The Deprecated category contains functions that had to be included in this version of Report Designer to provide backwards compatibility for files created with older Report Designer versions. You should never use any of these functions in new reports; there are no Deprecated functions that are not more sensibly implemented in other functions in other categories.
Formulas in Pentaho
formulation are used in lots of locations within a record for dynamic evaluation. Pentaho Reporting permits the definition of custom components functions so that builders may also amplify the functionality of the components subsystem.
OpenFormula defines the types, syntax, and semantics for calculated formulation, inclusive of many predefined features and operations, in order that formulas can be exchanged between applications and produce substantively identical outputs while recalculated with identical inputs. both closed and open source software program can put in force OpenFormula.
To define a method feature, you must implement the function interface located in the org.pentaho.reporting.libraries.formula.function package, as well as a Function Description described within the same package deal. word that this is a special feature interface as described earlier
for more details visit below links :-
Pentaho (v 8.2) formulas and function
Pentaho report design Interface