Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Location
    Oslo
    Posts
    45

    Arrow Unanswered: Save Asp "report/view" to file ? Filetype ?

    Hi and thanx for reading my post..

    Got a ASP page (viewresults.asp) which displays some values from a sql-db, based on some criterias from a search-form (html).

    What i'm trying to do is basically to save the report to disk. Not in html format but maybe as a word/excel document (or any other type of document, except html.)

    The asp page (viewresults.asp) is basically a ordinary page with a table displaying all the vaules specified in the strSQL query.

    Anyone got any good ideas of what code i can use to do this ?

    Best regards
    Terje-.,-

  2. #2
    Join Date
    Jan 2004
    Location
    Oslo
    Posts
    45

    problem solved - Solution -->

    A very easy solution indeed.. just didn't know it existed something _that_ easy in ASP *giggle..*

    Response.Buffer = TRUE
    Response.ContentType = "application/vnd.ms-excel"
    Response.Flush()

    ------------------------------
    Only problem is if you want a better look and design of the excel sheet, you'll have to use the Server.CreateObject("Excel.Application") object and put values into it like this :

    objExcel.ActiveSheet.Range("B" & i).Value = objRecords("Category")

    Like this you can altso specify width, height, font etc.etc.. just like a ordinary html page infact..

    Very useful when i now have learned it..

    Best regards
    Mirador.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •