Click here to Skip to main content
15,885,874 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Asp.Net Problem Pin
enjoycrack13-Apr-07 14:05
enjoycrack13-Apr-07 14:05 
AnswerRe: Asp.Net Problem Pin
Christian Graus13-Apr-07 20:14
protectorChristian Graus13-Apr-07 20:14 
GeneralRe: Asp.Net Problem Pin
Atif Ali Bhatti14-Apr-07 12:29
Atif Ali Bhatti14-Apr-07 12:29 
QuestionDropdown lists Pin
hahii13-Apr-07 8:19
hahii13-Apr-07 8:19 
AnswerRe: Dropdown lists Pin
Sujit Gupta13-Apr-07 9:14
Sujit Gupta13-Apr-07 9:14 
QuestionStoring User Information Pin
packerfan190413-Apr-07 6:01
packerfan190413-Apr-07 6:01 
Questionin multiview Pin
prabhu dot net13-Apr-07 4:26
prabhu dot net13-Apr-07 4:26 
QuestionExporting an ASP.NET table to Excel Pin
Rohde13-Apr-07 4:13
Rohde13-Apr-07 4:13 
Hi!

I'm trying to export an ASP.NET table control to Excel. But the Excel document is empty.

My code is (tblCommission is the ASP.NET table):

Response.Clear();<br />
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");<br />
Response.Charset = "";<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache);<br />
Response.ContentType = "application/vnd.xls";<br />
System.IO.StringWriter stringWrite = new System.IO.StringWriter();<br />
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);<br />
tblCommission.RenderControl(htmlWrite);<br />
Response.Write(stringWrite.ToString());<br />
Response.End();<br />


Why is the Excel document empty? Any help or info is greatly appreciated; so far Google hasn't helped me so I hope some of you can.



"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."

-Atlas Shrugged, Ayn Rand

AnswerRe: Exporting an ASP.NET table to Excel Pin
RichardGrimmer13-Apr-07 5:09
RichardGrimmer13-Apr-07 5:09 
GeneralRe: Exporting an ASP.NET table to Excel Pin
Rohde13-Apr-07 8:33
Rohde13-Apr-07 8:33 
QuestionDiscussion thread creation Pin
marky77713-Apr-07 3:58
marky77713-Apr-07 3:58 
AnswerRe: Discussion thread creation Pin
enjoycrack13-Apr-07 14:08
enjoycrack13-Apr-07 14:08 
QuestionSave dialog Control Pin
EEmaan13-Apr-07 3:41
EEmaan13-Apr-07 3:41 
AnswerRe: Save dialog Control Pin
enjoycrack13-Apr-07 3:58
enjoycrack13-Apr-07 3:58 
GeneralRe: Save dialog Control Pin
EEmaan13-Apr-07 9:08
EEmaan13-Apr-07 9:08 
GeneralRe: Save dialog Control Pin
Vasudevan Deepak Kumar14-Apr-07 3:52
Vasudevan Deepak Kumar14-Apr-07 3:52 
Questioncmd.addInparameter Pin
siddisagar13-Apr-07 3:01
siddisagar13-Apr-07 3:01 
AnswerRe: cmd.addInparameter Pin
_AK_13-Apr-07 3:03
_AK_13-Apr-07 3:03 
GeneralRe: cmd.addInparameter Pin
siddisagar13-Apr-07 3:51
siddisagar13-Apr-07 3:51 
GeneralRe: cmd.addInparameter Pin
RichardGrimmer13-Apr-07 5:10
RichardGrimmer13-Apr-07 5:10 
QuestionHelp in DotNetNuke ( its very urgent ) Pin
Faisal Khatri13-Apr-07 1:57
Faisal Khatri13-Apr-07 1:57 
QuestionHow to Multiview control on clientside Pin
vvijaykrishna13-Apr-07 1:52
vvijaykrishna13-Apr-07 1:52 
AnswerRe: How to Multiview control on clientside Pin
Jaiprakash M Bankolli13-Apr-07 2:00
Jaiprakash M Bankolli13-Apr-07 2:00 
AnswerRe: How to Multiview control on clientside Pin
kubben13-Apr-07 2:03
kubben13-Apr-07 2:03 
Questionretiveig columns Pin
yuvachandra13-Apr-07 1:31
yuvachandra13-Apr-07 1:31 

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.