Jump to content

Problem leading zeros in excel...


mike

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I think you need to do

Code:

xlsExporter.setParameter(JRXlsExporterParameter.IS_AUTO_DETECT_CELL_TYPE, Boolean.FALSE);

 

This flag is set by default, even though it has been deprecated by the new IS_DETECT_CELL_TYPE flag. We might reconsider this matter in the future and decide that the flag should be unset by default.

 

Regards,

Lucian

Link to comment
Share on other sites

Hi!

 

Mike I've tried IS_DETECT_CELL_TYPE but this has the down side that fields that you want to be numbers in the spreadsheet are saved as text.

 

So rather than using IS_DETECT_CELL_TYPE, I've used IS_AUTO_DETECT_CELL_TYPE so that numbers are saved as numbers and any numeric fields that require the leading zeroes I simply prepend a "'" (single quote) which signals to Excel to format the number as text. But please note that for some reason when initially opening the spreadsheet the single quote is displayed until I click on the cell and its text in the toolbar.

 

Mike or Lucian,

in a forum item I posted Dec 7/06 I explain that I'm getting a 'cannot resolve symbol' error when setting the IS_DETECT_CELL_TYPE (to set IS_DETECT_CELL_TYPE as described above I had to change the defaults in the code and recompile). Any ideas on what I'm doing wrong.

 

Thanks,

john

Link to comment
Share on other sites

  • 11 years later...

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...