Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 73573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:13:22+00:00 2026-05-10T20:13:22+00:00

I have some content that i have to render as a excel file in

  • 0

I have some content that i have to render as a excel file in browser. I was able to render a grid content to excel with the below code.

  Response.Clear();   Response.AddHeader('content-disposition', 'attachment;filename=FileName.xls');   Response.Charset = '';   Response.ContentType = 'application/vnd.xls';   System.IO.StringWriter stringWrite = new System.IO.StringWriter();   System.Web.UI.HtmlTextWriter htmlWrite =   new HtmlTextWriter(stringWrite);   GridView1.RenderControl(htmlWrite);   htmlWrite.Write(stringWrite);   Response.Write(stringWrite.ToString());   Response.End(); 

Now i have to do a similar thing for a image. That is, i want a code that can render a image to excel.

I mean when the user opens the excel he should be able to see the image in it.

Is it possible to convert the image to base64sting format and put it into the excel?

Please let me know if you have any idea similar to this.

Thanks Vinod T.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:13:22+00:00Added an answer on May 10, 2026 at 8:13 pm

    I’ve been using the same kind of hacks to get grid data (html tagged) into excel.

    If it is HTML data you are writing there, just add <IMG SRC=’MYFILENAME.JPG> into the HTML text where you want the images.

    What will happen, is that Excel will ask your server (asp.net app) for that file.

    You might have to add a full path to the image <IMG SRC=’http://myserver/subpath/MYFILENAME.JPG>

    Using a packet sniffer, I have verified that Excel in deed will ask for the IMG file, so just make sure you have placed the image ready for download. (either as an asp.net stream) or physically.

    My test HTML.
    <html>
    <table>
    <tr><td>test</td><td>test</td<td>test</td></tr>
    <tr><td>test</td><td>test</td><td>test</td></tr>
    <tr><td>test</td><td>test</td><td><img src=’http://myserver/LALLAALLAA.jpg’></td></tr>
    </table>
    </html>

    If ONLY Image, its the same as over only with no table tags at all. Just the HTML and IMG tag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In silverlight 2.0. I have some content that i want to scroll vertically and
I have a modal popup that initially shows some content but expands a div
I have a page in my application that refreshes some content (a list of
I have some code in .Net to draw some text content using GDI+. I
I have some user generated content I'm trying to render on my site. The
I have some UTF-8 content that includes multi-byte smart quote characters. I've found that
I have some content from server using $.ajax() function. I try to replace some
I have some flatpages with empty content field and their content inside the template
I have a situation where I'm loading some content using a URLLoader but the
I have some issue with a Perl script. It modifies the content of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.