Summing specific values

edited December 2003 in FastReport 2.xx VCL
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

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:06AM
    Hi Shlomi
    you will have to use your own variable to display the value and write your code in the obp event of the band. ;)
    regards
  • edited 11:06AM
    I got the same problem, is there any example can I learn?
    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).

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.