How To export datagrid with images to excel

Discussion in 'ASP .Net' started by Guest, Sep 28, 2005.

  1. Guest

    Guest Guest

    The datagrid is exporting but without the images. When the file is
    downloaded, it seems that the excel file was supposed to have the images
    because they appear as "broken" image in the file.

    This is the abbreviated approach that I am currently using.

    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/vnd.ms-excel"
    Response.Charset = ""
    Me.EnableViewState = False

    Dim oStringWriter As New System.IO.StringWriter()
    Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)

    datagrid.RenderControl(oHtmlTextWriter)

    Response.Write(oStringWriter.ToString())

    Response.End()

    How can I get the images to be included in the exported file?

    Thanks
     
    Guest, Sep 28, 2005
    #1
    1. Advertisements

  2. Guest

    saquib

    Joined:
    Jul 20, 2006
    Messages:
    1
    Likes Received:
    0
    Same Problem

    Hi all
    I am facing a new problem regarding Excel
    I am Exporting DataGrid to Excel but the problem is data is coming without images!!! i want to export datagrid with images. is there any way to solve this problem.
    thanks in advance
     
    saquib, Jul 20, 2006
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.