Control Panel
Forum
Hosting Help
6 Months free Hosting (New!)
Resources
Login
Members
Shared Hosting
|
New Features
|
Advertise
|
Tutorials
|
Product Reviews in India
|
Free aptitude test questions
|
TATA Nano Car reviews
Total
members
:
77417
Average new registrations per day (in last 7 days):
80
New Registration:
Open
Register Now
Home
»
Questions & Answers
»
Facing problem while exporting Completegridview to excel
Facing problem while exporting Completegridview to excel
4/8/2008
Author:
Shiva Kalluri
Hi all,
I'm using completegridview in one of my applications.
In that application I need to export it to excel, but the problem is while exporting the completegridview, the controls in that gridview, like another gridview labels in the detail template ane not getting rendered.
Hope any of you can help in this issue.
Thanks in advance.
Regards,
Shiva
Answers .............
Author:
ezra dayan
Posted Date: 5/9/2008
here is code in c# for export grid to excel:
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
if it's not work on your labels try convert 'htmlwrite' stream to binary use encoding functions.
You must
login
to post answer for this question.
Partners
Privacy Policy
Terms of use
Contact Us
SpiderWorks Technologies.
All Rights Reserved.