Weired RB Varaible problem
Hi,
I have a RB varaible component (varAmount) in the detail band, I set it to
Currency, timing is set to Traversal, Report End, in the detail band before
print event:
var
Amount: Currency
begin
Amount := 50;
varAmount.Value := Amount;
end;
the variable displays $0.00 always, but the following works:
var
Amount: Currency
begin
Amount := 50;
varAmount.Text := CurrToStr(Amount);
end;
How come???, I'm using RB7.01 and D7
William
end;
I have a RB varaible component (varAmount) in the detail band, I set it to
Currency, timing is set to Traversal, Report End, in the detail band before
print event:
var
Amount: Currency
begin
Amount := 50;
varAmount.Value := Amount;
end;
the variable displays $0.00 always, but the following works:
var
Amount: Currency
begin
Amount := 50;
varAmount.Text := CurrToStr(Amount);
end;
How come???, I'm using RB7.01 and D7
William
end;
This discussion has been closed.
Comments
In my testing with the exact code you gave below, the variable displayed 50
as expected. When I changed the TppVariable's type to Currency in the
designer it showed up as $50.00 as expected. Please update to RB 7.03 and
see if that helps. If not, please put together an example that shows this
behavior and send it to support@digital-metaphors.com and I'll take a look
at it.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I've found what the problem is, actually it is the bug in the
ReportBuilder, the Amount variable which defined in the RAP code CAN'T be
Currency, it must be Double to make it work.
var
Amount: Double; --> was Currency;
begin
Amount := 5;
varAmount.Value := Amount;
end;
then the Calc Variable displays correct value $5.00, not $0.00.
Hopefully it has been fixed in the RB7.03.
William
For future reference, please post all RAP questions in the RAP newsgroup.
In my testing with RB 7.03 in the OnCalc event of a TppVariable in RAP,
you're code below seemed to work as expected. Try updating to RB 7.03 as I
believe this issue has been addressed.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com