Click here to Skip to main content
15,887,027 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralQuestion Pin
nithydurai28-Apr-08 0:28
nithydurai28-Apr-08 0:28 
GeneralRe: Question Pin
eyeseetee28-Apr-08 0:40
eyeseetee28-Apr-08 0:40 
GeneralRe: Question Pin
Vasudevan Deepak Kumar28-Apr-08 1:34
Vasudevan Deepak Kumar28-Apr-08 1:34 
GeneralRe: Question Pin
DJ1618-Mar-13 8:29
DJ1618-Mar-13 8:29 
GeneralCopying large file using streaming Pin
248912828-Apr-08 0:21
248912828-Apr-08 0:21 
GeneralRe: Copying large file using streaming Pin
N a v a n e e t h28-Apr-08 0:28
N a v a n e e t h28-Apr-08 0:28 
GeneralRe: Copying large file using streaming Pin
Vasudevan Deepak Kumar28-Apr-08 1:35
Vasudevan Deepak Kumar28-Apr-08 1:35 
QuestionEmbed image in excelsheet Pin
sidbaruah27-Apr-08 23:45
sidbaruah27-Apr-08 23: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 2:13
Vasudevan Deepak Kumar28-Apr-08 2:13 
GeneralRe: Embed image in excelsheet Pin
sidbaruah28-Apr-08 2:42
sidbaruah28-Apr-08 2:42 
QuestionImage question Pin
Krazy Programmer27-Apr-08 23:01
Krazy Programmer27-Apr-08 23:01 
GeneralRe: Image question Pin
Abhijit Jana27-Apr-08 23:06
professionalAbhijit Jana27-Apr-08 23:06 
GeneralRe: Image question Pin
Krazy Programmer27-Apr-08 23:11
Krazy Programmer27-Apr-08 23:11 
GeneralRe: Image question Pin
rahul.net1127-Apr-08 23:19
rahul.net1127-Apr-08 23:19 
GeneralRe: Image question Pin
Krazy Programmer27-Apr-08 23:22
Krazy Programmer27-Apr-08 23:22 
GeneralRe: Image question Pin
rahul.net1127-Apr-08 23:33
rahul.net1127-Apr-08 23:33 
GeneralRe: Image question Pin
Krazy Programmer27-Apr-08 23:46
Krazy Programmer27-Apr-08 23:46 
GeneralRe: Image question Pin
N a v a n e e t h28-Apr-08 0:21
N a v a n e e t h28-Apr-08 0:21 
GeneralRe: Image question Pin
N a v a n e e t h28-Apr-08 0:19
N a v a n e e t h28-Apr-08 0:19 
GeneralRe: Image question [modified] Pin
Krazy Programmer28-Apr-08 0:31
Krazy Programmer28-Apr-08 0:31 
Generalmaintain set focus between postbacks Pin
Vinay Dornala27-Apr-08 22:50
Vinay Dornala27-Apr-08 22:50 
GeneralRe: Duplicate Post Please Ignore Pin
Abhijit Jana27-Apr-08 23:02
professionalAbhijit Jana27-Apr-08 23:02 
GeneralRe: Duplicate Post Please Ignore Pin
Vinay Dornala28-Apr-08 0:02
Vinay Dornala28-Apr-08 0:02 
GeneralRe: Duplicate Post Please Ignore Pin
_AK_28-Apr-08 0:09
_AK_28-Apr-08 0:09 
GeneralRe: maintain set focus between postbacks Pin
trish_28-Apr-08 1:25
trish_28-Apr-08 1: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.