View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] robertlafler@gmail.com is offline
external usenet poster
 
Posts: 1
Default Crystal Reports export to Excel - Loss of Leading Zeros

On Monday, November 1, 2004 at 11:48:04 AM UTC-4, CR-Tech wrote:
Crystal Enterprise is the web-based front-end server which displays
stored/linked Crystal reports to my target audience. I use an export
function that sends the report data to a .csv file so my users can open and
manipulate it in Excel. The file I'm trying to create MUST maintain the data
types of the underlying data fields, but currently is not retaining leading
zeros.

Leading zeros in various fields (ID#/SSN, Zip Codes, etc.) are not
recognized and retained by Excel because it seems the incoming field data is
seen as numerical instead of text. Using known pre-Excel formatting tricks
employing various combinations of using an apostrophe before the data,
enclosing the data in quotation marks (before and after), and using space(s)
in combination with the ' or " characters proves ineffective.

I am trying to correctly force-format the data containing leading zeros as
TEXT, BEFORE it reaches Excel, in order to retain these leading zeros.

Please offer assistance or solutions. Your help is most appreciated. Thanks.


If I'm not mistaken you can instead of adding the field into the report you can create a formula field with a "ToText({fieldname})" type of language and add that to your report instead. This will ensure the data is pulled into the Crystal Report as text and should export in the same manner.