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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PageNumber printing problem when printing from the web 1

Status
Not open for further replies.

DvDvDvDv

Programmer
May 24, 2001
100
PT
Hi all.

I need to have my pages numbered. When I include the PageNumber in my report, it prints: 1,00 or 2,00 or 3,00 etc.. (note the , is printed as the . in english settings)

To avoid this problem I created a formula (maybe there is a better way to do that. If you know it, please tell me):

"Pg. " + ToText (PageNumber)[1 to (InStr (ToText (PageNumber), ",") - 1)]

Ok. now it prints 1 or 2 or 3 etc..

BUT

When I print from the web, it prints again 1,00 or 2,00 or 3,00

Why it happens ?

Do you know how to fix it ?

Please help me

PS - I'm using the Viewer ActiveX
 
Got the solution:

Instead of using a formula, using the text field and including the special field in it.

Thanks all for helping me.

Anyway, still can't find out why sometimes , using the formula, it happens and sometimes no.

Well, doesn't matter.

Dv
 
DvDvDvDv,

The reason you got different results is that the conversion functions (such as ToText) are locale-sensitive and will check the local processor environment for things like number and date format.

You can remove that sensibility by including the explicit format code in the ToText function, i.e. ToText(PageNumber,"#"). Now the ToText call will always return an integer with no commas or other formatting.

This is a general problem/feature of Crystal Reports and should be taken into consideration when designing your reports. It also turns up when you are grouping on a year and see the group tree show up with entries such as "1,999.00", "2,000.00", "2,001.00".

Richard A. Polunsky
Houston, Texas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top