exporting excel in asp.net

Discussion in 'ASP .Net' started by theheathergirl@hotmail.com, Aug 31, 2006.

  1. Guest

    I have a page that has a button and it exports fine on the laptop but
    when I drop it on the server and hit it from a client machine on the
    LAN (https) it gives me an explorer error that it cannot download the
    page... The server has some certificates needs that my laptop does not,
    not sure if that is it. Any help would be awesome. code below:

    Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles btnExcel.Click
    Dim stringWrite
    Dim htmlWrite

    Response.Clear()
    Response.AddHeader("content-disposition",
    "inline;filename=EPRTracker.xls")
    Response.Charset = ""


    Response.Cache.SetCacheability(HttpCacheability.NoCache)
    Response.ContentType = "application/vnd.xls"
    stringWrite = New System.IO.StringWriter()
    htmlWrite = New HtmlTextWriter(stringWrite)
    Dim grdNew As New GridView()
    'grdNew.AutoGenerateColumns = True
    grdNew.DataSource =
    EPRTrackerLibrary.EPRTrackerView.GetStaffMeetReportDR
    grdNew.DataBind()

    grdNew.RenderControl(htmlWrite)
    Response.Write(stringWrite.ToString())
    Response.End()


    End Sub
     
    , Aug 31, 2006
    #1
    1. Advertising

  2. Attempt to hit another SSL page (https) and see if you have a certificate
    issue (server certificate). If so, correct it by trusting the root. This
    will have to be done on EVERY client.

    If, instead, you mean client side certs, that should not be a major deal.

    Also, make sure you have the Excel MIME type registered. I doubt it is your
    issue, but it WILL Cause issues of is own later.

    Hope this helps.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    *************************************************
    Think outside of the box!
    *************************************************
    <> wrote in message
    news:...
    >I have a page that has a button and it exports fine on the laptop but
    > when I drop it on the server and hit it from a client machine on the
    > LAN (https) it gives me an explorer error that it cannot download the
    > page... The server has some certificates needs that my laptop does not,
    > not sure if that is it. Any help would be awesome. code below:
    >
    > Protected Sub btnExcel_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles btnExcel.Click
    > Dim stringWrite
    > Dim htmlWrite
    >
    > Response.Clear()
    > Response.AddHeader("content-disposition",
    > "inline;filename=EPRTracker.xls")
    > Response.Charset = ""
    >
    >
    > Response.Cache.SetCacheability(HttpCacheability.NoCache)
    > Response.ContentType = "application/vnd.xls"
    > stringWrite = New System.IO.StringWriter()
    > htmlWrite = New HtmlTextWriter(stringWrite)
    > Dim grdNew As New GridView()
    > 'grdNew.AutoGenerateColumns = True
    > grdNew.DataSource =
    > EPRTrackerLibrary.EPRTrackerView.GetStaffMeetReportDR
    > grdNew.DataBind()
    >
    > grdNew.RenderControl(htmlWrite)
    > Response.Write(stringWrite.ToString())
    > Response.End()
    >
    >
    > End Sub
    >
     
    Cowboy \(Gregory A. Beamer\), Aug 31, 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. Michael

    Exporting to Excel in ASP.Net

    Michael, Apr 20, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    473
    Rick Spiewak
    Apr 22, 2004
  2. Goran Djuranovic
    Replies:
    0
    Views:
    372
    Goran Djuranovic
    Dec 10, 2004
  3. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,433
    Carl Prothman [MVP]
    Jan 12, 2005
  4. bienwell
    Replies:
    3
    Views:
    2,669
    bienwell
    May 17, 2005
  5. Doogie
    Replies:
    1
    Views:
    484
    sloan
    Nov 19, 2008
Loading...

Share This Page