CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Adding two aggregated fields in a report footer

Print topic Send  topic

Author Message
andy


Posts: 183
Posted: 07/25/2007, 3:09 PM

I have a report with two aggregated (sum) fields in the footer section.
I have created another label and tried adding them together as follows:

Control Source Type: Code Expression
Control Source: ($this->TotalSum_Amount->GetText()) - ($this->TotalSum_VATamount->GetText())

Unfortunately, rather than totalling the two fields TotalSum_Amount and TotalSum_VATamount it is totalling the first instance of the individual records in the report.

Can any one advise on what I'm doing wrong? Thanks.
_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 07/25/2007, 9:01 PM

Andy
I am wondering if your grouping is correct. Here is a link to the documentation maybe it can be of assistance: http://docs.codecharge.com/studio31/html/UserGuide/Forms/WebReporting.html
View profile  Send private message
andy


Posts: 183
Posted: 07/26/2007, 1:20 AM

What I am trying to achieve cannot be done within the usual reporting facilities, as I want to add together two DIFFERENT fields. If I were adding the same field from different report groups as the "grand total" then that would be straightforward.

My Report is like this (simplified):

_____________________________________
Report Header
_____________________________________
Page Header
Sorter A Sorter B Sorter C Sorter D Sorter E
_____________________________________
Group Header
_____________________________________
Detail Section
Field A Field B Field C Field D Field E
_____________________________________
Group Footer
_____________________________________
Page Footer
_____________________________________
Report Footer
- - - - - - - - - Sum C Sum D [SumC+SumD]
_____________________________________

I want to create my own report label [SumC+SumD], which is the product of adding together the aggregated fields Sum C (the sum of all field Cs in the report) and Sum D (the sum of all field Ds in the report).

I suspect that CCS is not using the aggregated product of Sum C and Sum D to then produce sum of Sum C + Sum D (some iteration issue?)

May be I should set this using a form level BeforeShow event?
What do you think??? Thanks!
_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message
andy


Posts: 183
Posted: 07/26/2007, 1:44 AM

I have just worked it out (hooray!).

On the Properties tab, my custom field set as a "Code Expression" control source type:

($this->TotalSum_Amount->GetText()) + ($this->TotalSum_VATamount->GetText())

critically has also have its "Function" property set to "Sum".

Phew... ;-)
_________________
Andy

RAD tools for rich UI controls:
http://www.koolphptools.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.