Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I change the a format field with a variable?

Status
Not open for further replies.

isdn123

IS-IT--Management
Feb 3, 2005
3
RO
I'm new on this forum and in the first time I want to give thanks to IBass who helped me, yesterday, only when I read one of his answers.
But , I have another problem and maybe you can help me.

In one of my subreports I need to appear a numeric field with 2 decimals or without decimals; this was made with a condition;

I created a variable in a subreport:

WhilePrintingRecords;
NumberVar valTVA;
valTVA:= ToNumber ({sbtable.TVA1})*ToNumber ({sbtable.TVA2}/100);
if {@tipvaluta}="AR" then valTVA:=Round (valTVA,2 );
valTVA;

where sbtable = subreport table

and my field it's set up from Format field -> Customize like this:

Decimals 1.00
Round 0.01

where @tipvaluta it's a shared variable created in my report, because only from there I can take the value:

WhilePrintingRecords;
shared stringvar tipvaluta:=" ";
tipvaluta:={rtable.TIP};
tipvaluta;

where stable= report table

and in my subreport:

WhilePrintingRecords;
shared stringvar tipvaluta;
tipvaluta;

And everything was ok with my shared variable , but in my report it doesn't appear without decimals.

What can I do?

 
You could do it with a formula field:
Totext({your.value}, 0) or Totext({your.value}, 2)

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top