Summing specific values
I have a field "price"
i show the report with the "price" field also.
i have an aggregate function wich sums all the "price" values.
I need another summing for this field that will sum all the "price"
values where the field "payed" wich is also shown is marked with '*',
if it's marked with '*' then it needs to be calculated and if it's marked
otherwise it needs to be ignored.
I know i can use variables and sum it in code, but i think there is a way to do
it in design time with the fastreport options, am i right?
In another words, in the memo object there is below 'begin' and 'end', there
i think i must put the code wich decides if to calculate or not, how do i use
this, and when?
Regards,
Shlomi
i show the report with the "price" field also.
i have an aggregate function wich sums all the "price" values.
I need another summing for this field that will sum all the "price"
values where the field "payed" wich is also shown is marked with '*',
if it's marked with '*' then it needs to be calculated and if it's marked
otherwise it needs to be ignored.
I know i can use variables and sum it in code, but i think there is a way to do
it in design time with the fastreport options, am i right?
In another words, in the memo object there is below 'begin' and 'end', there
i think i must put the code wich decides if to calculate or not, how do i use
this, and when?
Regards,
Shlomi
Comments
you will have to use your own variable to display the value and write your code in the obp event of the band.
regards
or pls. post some codes here or mail to me. thx.
here is the question:
memo1, value should be: sum(DataSet1.Price) where areacode = 'xp'
memo2, value should be: sum(DataSet1.Cost) where areacode = 'ed'
...
the report is designed in runtime, I can not point out in design time which fields may be used or which areacode user is care about (user can input areacode when program running).