stream excel sheet from binary database to the browser

Discussion in 'ASP General' started by Pedro Leite, Jun 13, 2006.

  1. Pedro Leite

    Pedro Leite Guest

    hello.

    got stalled at at point that i can no longer get my thoughts together.

    the point, is in classic asp, stream an excel file from a firebird database.
    temporarly save it if necessary
    stream it to the browser
    delete the temp file

    on googling, i found some examples but all assuming that the file is locally
    present.
    on the other hand, i beleive that is possible to stream the binary file and
    the save it locally to then present it to the browser, but i can't figure
    out how.

    anyone would help me on this ?? firefox friendly if possible.

    thank you in advance

    Pedro Leite From Portugal.
     
    Pedro Leite, Jun 13, 2006
    #1
    1. Advertising

  2. Pedro Leite

    Pedro Leite Guest

    i got this far

    with this code, i can gat the excel file from the database and present it on
    ie or pop the download box in ff
    -------------------------------------
    Response.Buffer = True
    ' Connection String
    Dim connStr
    connStr = "Provider=MSDASQL.1;Extended
    Properties=Driver={Firebird/Interbase(r)
    driver};Dbname=xxxxx-xxx:/xxx/xxx.gdb;CHARSET=ISO8859_1;PWD=xxxxxx;UID=xxxxx"
    ' Recordset Object
    Dim rs
    Set rs = Server.CreateObject("ADODB.Recordset")
    'Response.ContentType = "image/jpeg"
    ' opening connection
    rs.Open "SELECT NOME_FICHEIRO,NOME_LOGICO, FICHEIRO FROM TCS_XIBFS
    Where NOME_LOGICO = '" & request.querystring("doc") & "'", connStr, 2, 4

    Response.Clear()
    Response.ContentType = "application/x-msexcel"
    Response.BinaryWrite rs("FICHEIRO")
    Response.end
    ----------------------------------------
    Now, i would like to save the binary file in the client computer.
    been searching and found the binarystream object and tried this but no good
    'BinaryStream.Type = adTypeBinary
    'Open the stream And write binary data To the object
    'BinaryStream.Open
    'BinaryStream.Write rs("FICHEIRO") <-- this comes from the data base.
    'Save binary data To disk
    'BinaryStream.SaveToFile "c:\x.xls", adSaveCreateOverWrite

    anyone would please point me on the right direction ??

    thank you in advance

    Pedro Leite
    ----------------------------------














    "Pedro Leite" <naoehpreciso> escreveu na mensagem
    news:%...
    > hello.
    >
    > got stalled at at point that i can no longer get my thoughts together.
    >
    > the point, is in classic asp, stream an excel file from a firebird
    > database.
    > temporarly save it if necessary
    > stream it to the browser
    > delete the temp file
    >
    > on googling, i found some examples but all assuming that the file is
    > locally present.
    > on the other hand, i beleive that is possible to stream the binary file
    > and the save it locally to then present it to the browser, but i can't
    > figure out how.
    >
    > anyone would help me on this ?? firefox friendly if possible.
    >
    > thank you in advance
    >
    > Pedro Leite From Portugal.
    >
     
    Pedro Leite, Jun 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,394
    Carl Prothman [MVP]
    Jan 12, 2005
  2. Don
    Replies:
    3
    Views:
    2,058
  3. zxo102
    Replies:
    3
    Views:
    3,264
    Stuart Corrie
    Aug 9, 2005
  4. sajithkahawatta

    read a excel sheet using aspose.excel

    sajithkahawatta, Apr 19, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    550
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 19, 2007
  5. Tej
    Replies:
    1
    Views:
    187
    Bob Gustafson
    Apr 6, 2008
Loading...

Share This Page