| View previous topic :: View next topic |
| Author |
Message |
yggdrasiltrad General User

Joined: 10 Jun 2010 Posts: 8
|
Posted: Tue Jul 20, 2010 7:38 am Post subject: [Solved] Report Totals |
|
|
Hello,
I am using the Sun Report Builder and I'm trying to get totals for a report I'm working on. Unfortunately the total is not a simple sum, so I don't know if it is possible.
I have the report grouped by LastName and I have two fields that it is grouping. - Title and Accepted.
My report looks like :
LastName
Title Accepted
(Each last name may have several titles under it)
I wanted to know if at the bottom of the report I could get a count of the LastName and the count of Titles.
I am able to do a reportcounter which displays me the total number of Titles but not of the unique number of last names.
Is there anyway to acheive this?
Thanks for any help!
Last edited by yggdrasiltrad on Tue Jul 20, 2010 2:09 pm; edited 1 time in total |
|
| Back to top |
|
 |
BigAndy OOo Enthusiast

Joined: 03 Jan 2010 Posts: 150
|
Posted: Tue Jul 20, 2010 9:05 am Post subject: |
|
|
| Quote: | | I wanted to know if at the bottom of the report I could get a count of the LastName and the count of Titles. |
Yes, ypu can. Complete explanetion of using functions in SRB is here
But as for me i'd count in underlay query. |
|
| Back to top |
|
 |
Sliderule Super User


Joined: 29 May 2004 Posts: 2473 Location: 3rd Rock From The Sun
|
Posted: Tue Jul 20, 2010 10:21 am Post subject: |
|
|
yggdrasiltrad:
I think ( yes, Sliderule thinking can be dangerous to your health ) you have asked a good question.
I have created a SAMPLE OpenOffice file ( HSQL-DB-RPT02.odb ) with a few SRB ( Sun Report Builder ) sample reports.
One of the reports, I think, demonstrates exactly what you need.
The particular report shows how to create a Function . . . using the SRB function HASCHANGED to accomplish the task. According to documentation found here:
http://wiki.services.openoffice.org/wiki/SUN_Report_Builder/Functions
In my case, I wanted to COUNT the number of times a Group of the field "Table Name" occurred, and, I named the function [NoOfTables] . . . so . . . I coded the function ( using an IF statement ) as:
| Code: | | IF(HASCHANGED("Table Name")=1;[NoOfTables]+1;[NoOfTables]) |
Anyway, the file can be download from:
HSQL-DB-RPT02.odb ( only 275.25 KB ): http://www.mediafire.com/file/18rvgox54ij6yr0/HSQL-DB-RPT02.odb
Please review:
- Report: HSQL_Database_Table_Information - Grand Total1
- Function: NoOfTables
- Report Footer: Grand Total No Of Tables
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add [Solved] in your first post title ( edit button ) if your issue has been fixed / resolved. |
|
| Back to top |
|
 |
yggdrasiltrad General User

Joined: 10 Jun 2010 Posts: 8
|
Posted: Tue Jul 20, 2010 2:08 pm Post subject: |
|
|
Sliderule,
That did the trick. Thanks for the example. I don't think I would have ever figured that out myself!
Thanks so much! |
|
| Back to top |
|
 |
|