Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Number fields are rounded and appended with zero's Post Reply Post New Topic
Author Message
kennypraval
Newbie
Newbie


Joined: 09 Jun 2010
Online Status: Offline
Posts: 4
Quote kennypraval Replybullet Topic: Number fields are rounded and appended with zero's
     Posted: 09 Jun 2010 at 5:27am

Crystal reports version 2008

I have a very simple report,
I am trying to pass dynamic parameters from the report back to the database, the parameter is populated using a stored procedure from the database, the value in the database for an ID field is
-9024677091576119296 and Crystal is converting to this-9,024,677,091,576,120,000
 
I tried to format field using the File->Options->Fields->Number but the values still remain the same, I don't want Crystal to Round, Add Comma's for Thousand separator and add zeros at the end
 
Please help/advise
 
Thanks
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 09 Jun 2010 at 6:18am

Hi

Please can you let us know what database you are using and what is the field datatype.

cheers

Rahul

IP IP Logged
kennypraval
Newbie
Newbie


Joined: 09 Jun 2010
Online Status: Offline
Posts: 4
Quote kennypraval Replybullet Posted: 09 Jun 2010 at 6:20am
Oracle 10g field is Number(20)
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 09 Jun 2010 at 7:00am
Hi
 
I do not have Oracle 10g database, I am using sql server,I think oracle should have something similar
 
I used the sql CONVERT function to change the number to varchar and then display in crystal. I am not sure if you need to do calculations on the number, if yes they may not work as your are converting the number to character but if you just need to display then the below code works without rounding
 
I used the command object in Crystal

SELECT CONVERT(nvarchar,Fieldname) from Table
 
Cheers
Rahul
IP IP Logged
kennypraval
Newbie
Newbie


Joined: 09 Jun 2010
Online Status: Offline
Posts: 4
Quote kennypraval Replybullet Posted: 09 Jun 2010 at 7:59am
There is a To_Char function in Oracle, but this is an ID field I dont want to convert back and forth between NUMBER and CHAR
 
The question is Why is Crystal screwing around with the data ? why can't it display AS IS
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 09 Jun 2010 at 8:04am
Hi
 
I think crystal has limitation as it can display 16 digits only, I am not sure though please check the link below
 
 
Cheers
Rahul
IP IP Logged
kennypraval
Newbie
Newbie


Joined: 09 Jun 2010
Online Status: Offline
Posts: 4
Quote kennypraval Replybullet Posted: 09 Jun 2010 at 8:39am
Excellent Rahul, right on, this is what I needed, now I have no guilt converting it to CHAR
 
appreciate your help
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum