cancel
Showing results for 
Search instead for 
Did you mean: 

vrong value being shown for numeric field

Former Member
0 Kudos

Hallo,

we have the same problem as in the thread . But this question is marked as closed.

We work with Oracle11 Database and for the field with data_type NUMBER(5,0) the report shows for the value 80002 the value 14466. (80002 - 16^2).

Why is the other thread closed?

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member203619
Contributor
0 Kudos

One additional note - when using the replaceconnection method, you will notice that you can pass parameters which tell it not to verify the database when changing location. If you use this parameter - it should hopefully work for your report.

The line is:

int replaceParams = DBOptions._ignoreCurrentTableQualifiers + DBOptions._doNotVerifyDB;

Shawn

former_member203619
Contributor
0 Kudos

Hi Peter,

Some things that I would suggest trying are:

1. Why are you using both the setTableLocation method and the ReplaceConnection method - you should only be using one - not both at the same time. You can find a sample on how to use the ReplaceConnection method here:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/400ae826-3c11-2c10-15b5-dba41860...

2. Currently you are using the oracle jdbc driver - does this occur with any other drivers? What about the oracle jdbc thin client driver? I would like to determine if this issue is driver specific.

Thanks

Shawn

Former Member
0 Kudos

Hallo Shawn,

when we use only the ReplaceConnection method the shown value is correct. But then we have an other problem.

When the report uses views, the information of the owner of the view will be lost and the typ of the object changed to table. When you then open the report in the CR-Designer, he tells you, that he can't find the table and ask you, if you want to remove the table from the report. When you use both methods, the view is correct.

Thanks

Peter

former_member203619
Contributor
0 Kudos

Hi there,

I have a couple questions:

1. Is the original report designed off of a JDBC or an ODBC connection?

2. The datatype that is being returned appears to be coming from the database driver - when you are changing location - are you also changing what database driver is being used? (Either type or version)

3. Are you using CR Java / CR for Eclipse, or BOE Enterprise - and what version?

4. What happens if you change database location using the report designer? Or if you design a new report off of the database connection that you are changing to?

5. When you change DB location - do you use the setTableLocation method, or the ReplaceConnection method?

Thanks

Shawn

Former Member
0 Kudos

Hi Shawn,

here my answer:

1. Is the original report designed off of a JDBC or an ODBC connection?

The report only works with JDBC

Implementation-Vendor: Oracle Corporation

Implementation-Title: JDBC

Implementation-Version: 11.2.0.1.0

Specification-Vendor: Sun Microsystems Inc.

Specification-Title: JDBC

Specification-Version: 4.0

Main-Class: oracle.jdbc.OracleDriver

2. The datatype that is being returned appears to be coming from the database driver - when you are changing location - are you also changing what database driver is being used? (Either type or version)

No, the database driver is being the same.

3. Are you using CR Java / CR for Eclipse, or BOE Enterprise - and what version?

We are using CR Java.

Product-Name: Crystal Reports Runtime Components

Implementation-Title: Crystal Reports Runtime Components

Implementation-Version: 12.2.213.1476

4. What happens if you change database location using the report designer? Or if you design a new report off of the database connection that you are changing to?

When I change the database location in the report designer, the report is ok.

5. When you change DB location - do you use the setTableLocation method, or the ReplaceConnection method?

We use both methods.

Thanks

Peter

Former Member
0 Kudos

Hallo,

no help, no answer?

Former Member
0 Kudos

Here another Test:

create table tmp1

(

num1 NUMBER(1,0),

num2 NUMBER(2,0),

num3 NUMBER(3,0),

num4 NUMBER(4,0),

num5 NUMBER(5,0),

num6 NUMBER(6,0))

;

insert into tmp1 values(1,11,111,1111,11111,111111);

insert into tmp1 values(9,99,999,9999,99999,999999);

insert into tmp1 values(-1,-11,-111,-1111,-11111,-111111);

insert into tmp1 values(-9,-99,-999,-9999,-99999,-999999);

start report in CR-Designer or with JAVA:


NUM1 NUM2   NUM3  NUM4    NUM5     NUM6
1    11     111  1.111    11.111   111.111
9    99     999  9.999    99.999   999.999
-1  -11    -111 -1.111   -11.111  -111.111
-9  -99    -999 -9.999   -99.999  -999.999

change connection with JAVA (same tabledefinition) and start with JAVA :


NUM1 NUM2   NUM3  NUM4    NUM5     NUM6
1    11     111  1.111    11.111   111.111
9    99     999  9.999   -31.073   999.999
-1  -11    -111 -1.111   -11.111  -111.111
-9  -99    -999 -9.999    31.073  -999.999

This is a bug ?!

Former Member
0 Kudos

Here are some more information:

start report in CR-Designer or with JAVA: the value is 80002

DEBUG:

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - FieldManager

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - NDatabaseFields: 4

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - Field: {NP02_DURCHFUEHRUNG.NP02_NR_PRUEFER2}, NBytesInField: 4, ValueType: int32s

change connection with JAVA (same tabledefinition) and start with JAVA : the value is 14466

DEBUG:

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - FieldManager

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - NDatabaseFields: 4

INFO <main> com.crystaldecisions.reports.reportloading.saveddata.a() - Field: {NP02_DURCHFUEHRUNG.NP02_NR_PRUEFER2}, NBytesInField: 2, ValueType: int16s