Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Negative 'money' is shown incorrectly Post Reply Post New Topic
Author Message
George1
Newbie
Newbie


Joined: 23 Oct 2015
Online Status: Offline
Posts: 3
Quote George1 Replybullet Topic: Negative 'money' is shown incorrectly
    Posted: 08 Feb 2016 at 8:41am
Environment: CR-2008 (version 12.6.0.1596) on a 64 bit Windows-7. Connected to ASE 15 through ODBC.

Recently, all of a sudden, the reports which read negative values from 'money' fields started to show huge negative numbers - obvious signs of overflow.
In the simplest case, the query for a constant:
   select M=convert(money,-1)
The M field in the report is shown as ($922,337,203,685,478.00).

This problem exhibited by several independent installations of CR so I started to suspect that some changes were done to the database server. But DBAs are insisting that no such changes were made to the database server, and I cannot find anything which can be responsible for this in the server documentation.

Does anyone know what is going on and how to fix it?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 08 Feb 2016 at 12:38pm
Sounds like a overflow/underflow issue.  What field type is the 'money' field now?  If you want to make it negative, just multiply it by -1 (i.e, money *-1).
IP IP Logged
George1
Newbie
Newbie


Joined: 23 Oct 2015
Online Status: Offline
Posts: 3
Quote George1 Replybullet Posted: 09 Feb 2016 at 6:47am
Just did the straight forward test: wrote a tiny program in C which connects through the very same DSN, runs the very same query.
The result - no error.
SQLDescribeCol() reported
name=M type=3 size=19 decimals=4 nullable=0
The SQLGetData returned "-1.000" in the SQL_C_CHAR buffer.
So the problem is not in the ODBC and not in the database server.

but why several Crystal Reports installed on several independent computers suddenly started to print garbage???


IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 09 Feb 2016 at 9:17am
No idea what might be going on.
IP IP Logged
niha
Newbie
Newbie
Avatar

Joined: 05 Jun 2015
Online Status: Offline
Posts: 28
Quote niha Replybullet Posted: 12 Feb 2016 at 12:43am
No idea what is going on.
but You have one field of money from database so try to do basic format object using some function of Crystal Report and also round of it

I'm not so sure but might be it will help you.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.063 seconds.