Set Formatting When Exporting To Csv [closed]

JoseKreif

Member
I got a program, and it exports tracking numbers to a orders spreadsheet. When all is said and done, the travking numbers will be in scientific format.

Can I get progress to put them out as normal?

Or it this an Excel problem?

trk.PNG
 

Stefan

Well-Known Member
The maxmium precision for a number in Excel is 15 digits which your tracking number does not exceed. You will need to provide formatting. If you are creating your Excel file as an Excel 2003 XML file, setting the style to Format="0" will show your data correctly:

Code:
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <Styles>
  <Style ss:ID="sNumber">
   <NumberFormat ss:Format="0"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="ProgressTalk.com">
  <Table>
   <Column/>
   <Row>
    <Cell><Data ss:Type="String">Tracking</Data></Cell>
   </Row>
   <Row>
    <Cell ss:StyleID="sNumber"><Data ss:Type="Number">653815000001</Data></Cell>
   </Row>
  </Table>
 </Worksheet>
</Workbook>
 

Cringer

ProgressTalk.com Moderator
Staff member
You say in your title you're exporting to csv. That being the case, then yes, this is an Excel issue, not Progress. Open the csv in a text editor and you'll see your values are correct. Another gotcha with csvs and Excel is that Excel will strip leading 0's from numbers. That particular one can be a nightmare if you then save off the csv from Excel. As a rule of thumb, never edit csvs and save them off in Excel if you're worried about the formatting of the data.
 

JoseKreif

Member
You say in your title you're exporting to csv. That being the case, then yes, this is an Excel issue, not Progress. Open the csv in a text editor and you'll see your values are correct. Another gotcha with csvs and Excel is that Excel will strip leading 0's from numbers. That particular one can be a nightmare if you then save off the csv from Excel. As a rule of thumb, never edit csvs and save them off in Excel if you're worried about the formatting of the data.

Thanks for the insight.
 
Top