Skip to main content
Inspiring
June 22, 2010
Question

Excel Question

  • June 22, 2010
  • 1 reply
  • 2498 views

I have a CF application that outputs carrier tracking numbers. I need to export this data to excel. If the output is 1Z234TY988784AQ, the export works fine because of the alphas. If the output is 1234567890, without any alpha, excel thinks it is a number and exports it in the scientific notation. If I put a space at the beginning or end, then the ouput works fine.

However, the user then takes the excel file and uses it to compare against another file with carrier tracking numbers. They claim they are not finding any matches becasue of the space.

How do I get around the scientific export  ? Will csv file work ? I have not found any documentation yet on csv so I thought I would post my problem here.

Thanks

This topic has been closed for replies.

1 reply

ilssac
Inspiring
June 22, 2010

What version of CF?

How are you exporting to Excel?

Have you confirmed that the number is actually exported as scientific notation, or is Excel just displaying it as scientific notation.

If the latter, then it is probably up to the user to change how the cell display the data.

trojnfnAuthor
Inspiring
June 22, 2010

It is cf 7

Here is the export command :

<cfsetting enablecfoutputonly="Yes" >
<cfheader name="Content-Disposition" value="attachment;filename=advancedSearchResults.xls">
<cfcontent type="application/vnd.ms-excel" >

I guess excel is displaying 375070700100000014....... as 3.75051E+31, but dont know if it is exporting it that way or not.

CF displays it at 37507070010000014........that is th e actual value.

Inspiring
June 22, 2010

Try putting a single quote prior to your values.  A more complete code sample might also be helpful.