Difference between revisions of "SUN Report Builder/Example"
From Apache OpenOffice Wiki
DrewJensen (Talk | contribs) (→data) |
m |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
Products Table ( Table2 ) | Products Table ( Table2 ) | ||
− | {| class=" | + | {| class="wikitable" cellpadding="10" border="1" |
| <center>ProductID</center> | | <center>ProductID</center> | ||
| <center>ProductName</center> | | <center>ProductName</center> | ||
− | |||
|- | |- | ||
| <center>0</center> | | <center>0</center> | ||
| <center>Apples</center> | | <center>Apples</center> | ||
− | |||
|- | |- | ||
| <center>1</center> | | <center>1</center> | ||
| <center>Oranges</center> | | <center>Oranges</center> | ||
− | |||
|- | |- | ||
| <center>2</center> | | <center>2</center> | ||
| <center>Grapes</center> | | <center>Grapes</center> | ||
− | |||
|- | |- | ||
| <center>3</center> | | <center>3</center> | ||
| <center>Melons</center> | | <center>Melons</center> | ||
− | |||
|} | |} | ||
Product Cost Table ( Table1 ) | Product Cost Table ( Table1 ) | ||
− | {| class=" | + | {| class="wikitable" cellpadding="10" border="1" |
| <center>ProdID</center> | | <center>ProdID</center> | ||
| <center>Cost</center> | | <center>Cost</center> | ||
− | |||
|- | |- | ||
| <center>0</center> | | <center>0</center> | ||
| <center>2</center> | | <center>2</center> | ||
− | |||
|- | |- | ||
| <center>0</center> | | <center>0</center> | ||
| <center>1</center> | | <center>1</center> | ||
− | |||
|- | |- | ||
| <center>0</center> | | <center>0</center> | ||
| <center>3</center> | | <center>3</center> | ||
− | |||
|- | |- | ||
| <center>0</center> | | <center>0</center> | ||
| <center>4</center> | | <center>4</center> | ||
− | |||
|- | |- | ||
| <center>1</center> | | <center>1</center> | ||
| <center>1</center> | | <center>1</center> | ||
− | |||
|- | |- | ||
| <center>1</center> | | <center>1</center> | ||
| | | | ||
− | |||
|- | |- | ||
| <center>1</center> | | <center>1</center> | ||
| <center>4</center> | | <center>4</center> | ||
− | |||
|- | |- | ||
| <center>1</center> | | <center>1</center> | ||
| <center>7</center> | | <center>7</center> | ||
− | |||
|- | |- | ||
| <center>2</center> | | <center>2</center> | ||
| <center>9</center> | | <center>9</center> | ||
− | |||
|- | |- | ||
| <center>3</center> | | <center>3</center> | ||
| | | | ||
− | |||
|- | |- | ||
| <center>3</center> | | <center>3</center> | ||
| | | | ||
− | |||
|} | |} | ||
The report will display all cost records for each product, and group by the product name. Therefore a query is used to put the data from the two tables into one contiguous result set, for use by the report builder. | The report will display all cost records for each product, and group by the product name. Therefore a query is used to put the data from the two tables into one contiguous result set, for use by the report builder. | ||
+ | [[Image:Sum_exmp_qry.gif]] | ||
− | Report layout | + | Report layout - User defined functions |
+ | The Sun Report Builder allows creation of user defined functions at two levels. The report level and the group level. | ||
− | |||
− | + | [[Image:Group Report Totals.gif|550px]] | |
+ | Final report output | ||
− | [[Image: | + | |
+ | [[Image:Sum_exmp_rpt.gif|center|thumb|200px]] | ||
+ | |||
+ | |||
+ | [[Category:Sun Report Builder]] | ||
+ | [[Category:Base Documentation]] | ||
+ | {{CCBY}} |
Latest revision as of 13:31, 21 May 2024
Data Model
The example will use a very simple, and common, data model. Two tables, one a list of products and the other a list of the cost for multiple purchases of each product. Referred to as One to Many ( 1..n) relation.
Products Table ( Table2 )
|
|
|
|
|
|
|
|
|
|
Product Cost Table ( Table1 )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The report will display all cost records for each product, and group by the product name. Therefore a query is used to put the data from the two tables into one contiguous result set, for use by the report builder.
Report layout - User defined functions
The Sun Report Builder allows creation of user defined functions at two levels. The report level and the group level.
Final report output
Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY). |