Sharon wrote:
[color=blue]
> I'm trying to add an export option to my application. I use Javascript
> DOM to transform XHTML-tables displayed in the browser window to
> CSV-format (client-side) using a simple XSL. All works fine, except
> that I can't seem to get any further than alerting the output
> *sigh*... Who can give me hints on how to get the output to the client
> somehow? Should I save it to the server first and then allow the
> client to get it from there, or can I pass it directly back to the
> client who pressed the export button and requested it? I tried writing
> the output to a document and then do execCommand to let the client
> save it but
> 1) I don't want the output in a new window, I just want the 'save as'
> dialog to appear directly. But the execcommand method needs an object
> e.g. the document and I don't know how to circumvent this...
> 2) the 'save as' dialog only allows me to save the output as *txt or
> *html and does not have ANSI coding as an option. As a result, when I
> save the file as html using the default coding (Unicode) and open it
> in Excel all data are displayed in one column. I need ANSI. (When I
> open the csv in Notepad and save it with ANSI coding it is displayed
> correctly in Excel).
> Who can give me a hint on what to do next? I'm desperately waiting for
> your replies, TIA![/color]
What you have is IE/Win or even IE 6/Win only as you are using MSXML 3.
If you know that you only have such clients then maybe you can write an
HTA( HTML application) where you then have access to object like
ADODB.Stream or the FileSystemObject to save the result directly on the
client.
If not then it seems better to use the server to to the transformation
and save it back to the client.
--
Martin Honnen
http://JavaScript.FAQTs.com/