OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved] Report Totals

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
yggdrasiltrad
General User
General User


Joined: 10 Jun 2010
Posts: 8

PostPosted: Tue Jul 20, 2010 7:38 am    Post subject: [Solved] Report Totals Reply with quote

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
View user's profile Send private message
BigAndy
OOo Enthusiast
OOo Enthusiast


Joined: 03 Jan 2010
Posts: 150

PostPosted: Tue Jul 20, 2010 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Tue Jul 20, 2010 10:21 am    Post subject: Reply with quote

yggdrasiltrad:

I think ( yes, Sliderule thinking can be dangerous to your health Smile ) 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

http://wiki.services.openoffice.org/wiki/SUN_Report_Builder/Functions wrote:


HASCHANGED

Checks whether the columns specified by the given names has changed. Place a column name between double quotes.


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:
  1. Report: HSQL_Database_Table_Information - Grand Total1

  2. Function: NoOfTables

  3. 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
View user's profile Send private message
yggdrasiltrad
General User
General User


Joined: 10 Jun 2010
Posts: 8

PostPosted: Tue Jul 20, 2010 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group