Jump to content
Changes to the Jaspersoft community edition download ×

A weird XLS bug (7E0345 --> 1.7977E+308)


Recommended Posts

By: Tuan Le - lesoft

A weird XLS bug (7E0345 --> 1.7977E+308)

2003-12-15 10:51

In our Excel report we have one String field that displays our company job code, and the Excel report returns all the job code correctly with the exception of any job code starting with 1Exxxx. For example,

 

in database, job code is 7E0345

in Excel output, job code is 1.7977E+308

 

It seems that whenever we have a job cod starting with 1E, JasperReport/Excel converts it into an expontial value.

 

How do we prevent that to happens? The job code is a field of type String.

 

Thanks,

Tuan

 

 

 

 

By: Tuan Le - lesoft

RE: A weird XLS bug (7E0345 --> 1.7977E+308)

2003-12-19 12:56

Can some one please confirm whether this is a bug in the JasperReport, POI, or some thing that I missed.

 

I'm sure that some one has generated a report with a text value of 1Exxxxxxx in a String type cell before.

 

Thanks,

Tuan

 

 

 

 

By: Carlos Costa e Silva - carloscs

RE: A weird XLS bug (7E0345 --> 1.7977E+308)

2003-12-19 16:11

Probably excel is handling 7E0345 as a number: same as 7.0E+345 (and probably overflowing also, that's why the +308).

 

Try either formmating the field as text or setting the value with a starting quote:

 

cell.setString("'" + job_code);

 

 

 

 

 

By: Tuan Le - lesoft

RE: A weird XLS bug (7E0345 --> 1.7977E+308)

2003-12-19 16:32

Carlos -

 

Thanks for your reply. We have tried to format the Excel column as text but that didn't help. By adding a starting quote in the Job Code column is not a good option for our report since the user may take this Excel report and import into another database.

 

Thanks,

Tuan

 

 

 

 

By: Teodor Danciu - teodord

RE: A weird XLS bug (7E0345 --> 1.7977E+308)

2004-01-10 11:52

 

Hi,

 

The XLS exporter found in the CVS repository

has now a parameter IS_AUTO_DETECT_CELL_TYPE

which allows you to avoid such behavior.

Set this exporter parameter to Boolean.FALSE

and all the cells will be of type text.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...