[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Retaining the leading zeros in zip codes, etc. when writing t o file to be opened in Excel. A way to do it.



Thanks Franck,
This is pretty neat folks.  It opens up a whole new dimension for SQR output
to Excel that includes formatting.
It also allows retaining the illusive leading zeros in columns formatted as
'General' or as 'Text'.
Jim


-----Original Message-----
From: Franck Masson [mailto:franck.masson@BRIO.COM]
Sent: Thursday, January 11, 2001 8:14 PM
To: SQR-USERS@list.iex.net
Subject: Re: question: format an excel file (.xls) inside sqr program


James,

when i have to provide a .SLK file formatted as the enduser expect.
I use excell to create the template with 2 or 3 lines.
then i save it in .slk format.
open it in notepad
cut it in 3 parts
the header with column heading that i store in top.txt file
the line of value
that i code in sqr
the bottom that i store in bottom.txt file ( if there is some sum at the
end)

then in my SQR code
1) i copy the top.txt in result.xls
2) create the line using sqr to write to result.xls
3) copy the Bottom.txt in result.xls

you can have something like this ( see attachment)
( in the attachment i have coded in sqr top.txt, but it is easy to store
it in a file and read this file and add it to result.xls.)

Franck,

PS: You have to optmise the way you design your excell template.
do not apply multiple time the format of cells.



James Womeldorf wrote:
>
> Has anyone out there messed around with the .SLK format for writing text
> files to be opened by Excel?
> Preliminary tests I have done look hopeful.  Leading zeros in strings like
> 0010 can be retained, and it is even possible to format columns (and
> individual cells, I expect) but the format of the file is a bit odd (and
> terse).
> If anyone knows just how the .SLK files are laid out I would be
interested.