Click here to Skip to main content
15,795,581 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralQuestion Pin
nithydurai28-Apr-08 1:28
nithydurai28-Apr-08 1:28 
GeneralRe: Question Pin
eyeseetee28-Apr-08 1:40
eyeseetee28-Apr-08 1:40 
GeneralRe: Question Pin
Vasudevan Deepak Kumar28-Apr-08 2:34
Vasudevan Deepak Kumar28-Apr-08 2:34 
GeneralRe: Question Pin
DJ1618-Mar-13 9:29
DJ1618-Mar-13 9:29 
GeneralCopying large file using streaming Pin
248912828-Apr-08 1:21
248912828-Apr-08 1:21 
GeneralRe: Copying large file using streaming Pin
N a v a n e e t h28-Apr-08 1:28
N a v a n e e t h28-Apr-08 1:28 
GeneralRe: Copying large file using streaming Pin
Vasudevan Deepak Kumar28-Apr-08 2:35
Vasudevan Deepak Kumar28-Apr-08 2:35 
QuestionEmbed image in excelsheet Pin
sidbaruah28-Apr-08 0:45
sidbaruah28-Apr-08 0:45 
Hi!
I have a peculiar situation.
I need to export an image and a gridview control to excel.

im using rendercontrol for image and datagrid, however, the image only exports it with a link to the actual location.
The code snippet is :
//Code starts
Response.AddHeader("content-disposition", "attachment; filename=Export.xls");
Response.ContentType = "Application/vnd.ms-excel";
Response.ContentType = "Application/vnd.ms-excel";
System.IO.StringWriter strW = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(strW);
HtmlImage himg = new HtmlImage();
System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath("Charts.aspx"));
himg.Src = Server.MapPath("Charts.jpg");
himg.RenderControl(htw);
HtmlTable tbl1 = new HtmlTable();
int intRows = 0;
while (intRows < 23)
{
HtmlTableRow hrow = new HtmlTableRow();
tbl1.Rows.Add(hrow);
intRows++;
}
tbl1.RenderControl(htw);
GridView1.RenderControl(htw);
Response.WriteFile(Server.MapPath("RRAT_Charts.jpg"));
Response.Write(strW.ToString());
Response.End();
//code ends
What i need is to embed the image on to the excelsheet.
How can i do that?
Any ideas?

Thanks in advance!!

I was born dumb!!
Laugh | :laugh: Programming made me laughLaugh | :laugh: !!!
--sid--

GeneralRe: Embed image in excelsheet Pin
Vasudevan Deepak Kumar28-Apr-08 3:13
Vasudevan Deepak Kumar28-Apr-08 3:13 
GeneralRe: Embed image in excelsheet Pin
sidbaruah28-Apr-08 3:42
sidbaruah28-Apr-08 3:42 
QuestionImage question Pin
Krazy Programmer28-Apr-08 0:01
Krazy Programmer28-Apr-08 0:01 
GeneralRe: Image question Pin
Abhijit Jana28-Apr-08 0:06
professionalAbhijit Jana28-Apr-08 0:06 
GeneralRe: Image question Pin
Krazy Programmer28-Apr-08 0:11
Krazy Programmer28-Apr-08 0:11 
GeneralRe: Image question Pin
rahul.net1128-Apr-08 0:19
rahul.net1128-Apr-08 0:19 
GeneralRe: Image question Pin
Krazy Programmer28-Apr-08 0:22
Krazy Programmer28-Apr-08 0:22 
GeneralRe: Image question Pin
rahul.net1128-Apr-08 0:33
rahul.net1128-Apr-08 0:33 
GeneralRe: Image question Pin
Krazy Programmer28-Apr-08 0:46
Krazy Programmer28-Apr-08 0:46 
GeneralRe: Image question Pin
N a v a n e e t h28-Apr-08 1:21
N a v a n e e t h28-Apr-08 1:21 
GeneralRe: Image question Pin
N a v a n e e t h28-Apr-08 1:19
N a v a n e e t h28-Apr-08 1:19 
GeneralRe: Image question [modified] Pin
Krazy Programmer28-Apr-08 1:31
Krazy Programmer28-Apr-08 1:31 
Generalmaintain set focus between postbacks Pin
Vinay Dornala27-Apr-08 23:50
Vinay Dornala27-Apr-08 23:50 
GeneralRe: Duplicate Post Please Ignore Pin
Abhijit Jana28-Apr-08 0:02
professionalAbhijit Jana28-Apr-08 0:02 
GeneralRe: Duplicate Post Please Ignore Pin
Vinay Dornala28-Apr-08 1:02
Vinay Dornala28-Apr-08 1:02 
GeneralRe: Duplicate Post Please Ignore Pin
_AK_28-Apr-08 1:09
_AK_28-Apr-08 1:09 
GeneralRe: maintain set focus between postbacks Pin
trish_28-Apr-08 2:25
trish_28-Apr-08 2:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.