-
Exporting to Excel
Hi,
While exporting to excel all my grids and tables are binding properly but,
the controls inside the grids and tables are allining left, What is wrong with my coding?
passing Table id(one) which contains all my grids and tables to export
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
// If you want the option to open the Excel file without saving than
// comment out the line below
// 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);
// this.EnableViewState = false;
// EnableEventValidation="false" = false;
one.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
without for tag (for using content place holder)
public override void VerifyRenderingInServerForm(Control control)
{
// Confirms that an HtmlForm control is rendered for the
//specified ASP.NET server control at run time.
}
Help needed..
Althaf
 ALTHAF
Similar Threads
-
By JeTmAn in forum ASP.NET
Replies: 1
Last Post: 06-04-2007, 04:19 PM
-
By sameerce in forum ASP.NET
Replies: 1
Last Post: 08-26-2006, 09:08 PM
-
By biswajitp in forum VB Classic
Replies: 0
Last Post: 03-28-2006, 09:50 AM
-
By Magic in forum VB Classic
Replies: 26
Last Post: 12-15-2005, 10:53 AM
-
By sunilbenjamin in forum ASP.NET
Replies: 3
Last Post: 10-06-2005, 10:47 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks