|
This has been discussed before. I get around this by creating a HTML file with the Excel namespace. Here is some documentation I wrote for my coworkers on the subject. Not comprehensive but works for us. Create an Excel file from AS/400 or ASP It is possible to create a file that Excel likes without being an actual Excel-formatted file. The trick is to create a HTML file, but named .xls. A template for creating the HTML file: <html xmlns:x="urn:schemas-microsoft-com:office:excel"> <table border="1"> <!-- insert table rows here --> </table> </html> Example file excelhtml.xls: <html xmlns:x="urn:schemas-microsoft-com:office:excel"> <table border="1"> <tr> <th>Product Id</th> <th>Description</th> <th>On Hand</th> <tr> <td align="left"> WIDGET-A</td> <td align="left">A Widget</td> <td>0</td> </tr> <tr> <td align="left">WIDGET-B</td> <td align="left">B Widget</td> <td align="left" x:str="'00225">00255</td> </tr> </table> </html> Notes: . Using the <td align="left" x:str="'00225">00255</td> format creates a numeric field with leading zeroes, equivalent to typing '00025 in a cell. . Creating a <th> row will automatically boldface the headings, just as it does in HTML. HTH, Loyd -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Emmanuel Zannis Sent: Thursday, December 23, 2004 11:03 AM To: midrange-l@xxxxxxxxxxxx Subject: Excel leading zeros Hi all, I created an XLS file by calling C-function within my RPG. The file opens successfully in Excel. The only problem is that I am loosing my leading zeros in alphanumeric values. Is there a way to tell Excel that those fields are text fields in the form of a hex value? The fields are successfully delimited by using x'05'. Regards, Emmanuel Zannis (Tel: 01252 372000 x3262 Fax: 01252 542261 e-mail:emmanuel.zannis@xxxxxxxxxxx The above information is confidential to the addressee and may be privileged. Unauthorised access and use is prohibited. If you received this message in error please tell us by reply (or telephone the sender) and delete all copies from your system. Internet communications are not secure and therefore this Company does not accept legal responsibility for the contents of this message. This e-mail message has been swept by Activis e:)scan for the presence of detectable computer viruses, but we cannot guarantee that it is virus-free and you should scan this email for viruses prior to opening or saving any attachments. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Please note that communications sent by or to any person through our computer systems may be viewed by other members of the Hogg Robinson group. Hogg Robinson plc Registered Office: Abbey House, 282 Farnborough Road, Farnborough, Hampshire GU14 7NJ Registered in England and Wales No 2107443 -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.