Professional Web Applications Themes

Export to Excel sheet - ASP

You may refer to this KB article: [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q288130[/url] Luke (This posting is provided "AS IS", with no warranties, and confers no rights.)...

  1. #1

    Default RE: Export to Excel sheet

    You may refer to this KB article:

    [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q288130[/url]

    Luke

    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Luke Zhang [MSFT] Guest

  2. #2

    Default Re: Export to Excel sheet

    Thanks XR.

    The function code works great. It fix my problem when user has a line break
    in the text box.

    Thanks a lot.

    Lin


    "XR" <xrongg> wrote in message
    news:0b7a01c33cb6$e2467a90$a401280aphx.gbl...
    > [CSV use , as default dilimiter. ]
    >
    > iID = rs("ID")
    >
    > sTemp = iID & "," & stringTOCSV(rs("taname")) & ",," &
    > stringTOCSV(rs("Countryname"))
    >
    > f.writeLine(sTemp)
    >
    > '--------------------------
    > ' Convert input string to fit the CSV formating '
    > ' Returns formated input string '
    > '--------------------------
    >
    > function StringToCSV(xIn)
    > Dim xOut
    > if not xIn = "" then
    > xOut = Trim(xIN)
    > xOut = replace(xOut, """", """""")
    > xOut = """" & xOut & """"
    > StringToCsv = xOut
    > Else
    > stringToCsV = xIn
    > End if
    > End function
    >
    >
    > >-----Original Message-----
    > >Thanks. But it only write to one column. How to write
    > more than one column?
    > >
    > >I try to use f.WriteLine ("The information you want") &
    > ("this is column
    > >2")
    > >
    > >But it is not working.
    > >
    > >Thanks,
    > >
    > >Lin
    > >
    > >
    > >"XR" <Xrongg> wrote in message
    > >news:026c01c33c1d$f0e60370$a501280aphx.gbl...
    > >> sFName = "ReportCache\Report_time.csv"
    > >>
    > >> set fs = server.createObject
    > ("scripting.fileSystemObject")
    > >> set f = fs.createTextFile(server.mappath(sFName))
    > >> sql = your sql statement
    > >> Set Rs = conn.execute(sql)
    > >> if not rs.eof then
    > >> do while not rs.eof
    > >> f.WriteLine ("The information you want")
    > >> rs.moveNext
    > >> loop
    > >> end if
    > >> rs.close
    > >> set rs = Nothing
    > >>
    > >> set f = Nothing
    > >> set fs = Nothing
    > >>
    > >>
    > >>
    > >
    > >
    > >.
    > >

    Lin Ma Guest

  3. #3

    Default Re: Export to Excel sheet

    Thanks Curt.

    Now I know how to convert a table into Excel. Cool.

    Lin Ma


    "Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
    news:OvbDw$CPDHA.704tk2msftngp13.phx.gbl...
    > Using Excel from ASP
    > [url]http://www.darkfalz.com/1085/[/url]
    >
    >
    > --
    > ----------------------------------------------------------
    > Curt Christianson (Software_AT_Darkfalz.Com)
    > Owner/Lead Designer, DF-Software
    > [url]http://www.Darkfalz.com[/url]
    > ---------------------------------------------------------
    > ..Offering free scripts & code snippits for everyone...
    > ---------------------------------------------------------
    >
    > "Lin Ma" <aa.com> wrote in message
    > news:#NmPfkBPDHA.2160TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > From my asp page, after user run a search query, I need this query
    result
    > to
    > > be displayed in a spread sheet. A csv file?
    > >
    > > Does anyone know how to do?
    > >
    > > Thanks,
    > >
    > > Lin Ma
    > >
    > >
    >
    >

    Lin Ma Guest

Similar Threads

  1. How to get the name of an Excel sheet?
    By zz3top in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 11th, 05:36 AM
  2. Export to Excel shows an empty sheet
    By Paul D. Fox in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: April 11th, 03:07 PM
  3. exporting to an excel sheet
    By El Bucanero in forum PHP Development
    Replies: 7
    Last Post: June 16th, 08:47 AM
  4. Export IPTC-Headers into Excel-Sheet
    By Rike in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 0
    Last Post: August 26th, 08:08 AM
  5. Excel Sheet Export
    By Ricky_Singh in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 1st, 11:05 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139