Home RAP

Two Questions: FormatCurr and Order of Display

edited March 2010 in RAP
Hi, I have two questions.
In the OnGetText of a label, I call the following for a currency.
Text := FormatCurr('%8.2m', cost);
However the label when printed is '%82m'. What's the proper usage of
FormatCurr?

My second question is, is there a way to set the order of printing within a
group? I have six groups, and within a particular group I have three labels
and two report-wide variables. I set the text of two of the labels to the
variables, and on the third label I set the text to the sum of the two
variables, then in the same function set the variables to 0 so that future
groups increment the variables from 0.
(Third label's OnGetText)
begin
Text := CurrToStr(costR + costL);
costR := 0;
costL := 0;
end;

I do this so subgroups (the smaller dataset) begin incrementing costR and
costL from 0, to properly represent the subgroups when this group is printed
again. I have to do this has I can't do quite what I want in SQL alone, so
I have to do this extra processing with extra report variables. If this
isn't clear (which is quite possible), please let me know and I'll go in to
far more detail.

Thank you,
-Steve

Comments

  • edited March 2010


    FormatCurr('$,0', aValue)

    I believe it's also documented in the help file.



    The order is determined by the order of your data.


    you can set the timing of the variable to reset on the group traversal by
    right clicking over the variable.

    There's a small demo here:

    www.retireneeds.com/misc/DemoVariablesPrj.zip

    Ed Dressel
    Team DM
  • edited March 2010
    Perfect, thank you.

This discussion has been closed.