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 |
 |
 |
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
|
 |
 |
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 |
 |
 |
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 |
 |
 |