Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 21st, 2008, 11:36 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default export to excel (Urgent)

Dear all,
I am exporting a grid to excel. While exporting everthing work fine. But after 1700 records all the fields changes to text. Means now we can't use them in formula.
Kindly Help
Code is as follow:
           grdDetails.AllowPaging = false;
            BindGrid();


            grdDetails.HeaderStyle.BackColor = System.Drawing.Color.White;
            grdDetails.HeaderStyle.ForeColor = System.Drawing.Color.Black;
            string attachment = "attachment; filename=Report.xls";
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType = "application/ms-excel";
            StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            // Create a form to contain the grid
            HtmlForm frm = new HtmlForm();

            grdDetails.Parent.Controls.Add(frm);
            frm.Attributes["runat"] = "server";
            frm.Controls.Add(grdDetails);
            frm.RenderControl(htw);
            //GridView1.RenderControl(htw);
            //string styleInfo = @".NumberString {mso-number-format:\@;}";
            Response.Write(sw.ToString());
            Response.End();
            grdDetails.AllowPaging = true;

  #2 (permalink)  
Old August 30th, 2008, 09:30 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

i donot feel bug here in code

thanks......


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to Excel Suresh62 Access 0 May 19th, 2008 06:38 AM
Export to Excel maigoro ASP.NET 3.5 Basics 5 April 10th, 2008 11:32 PM
export excel file ( format is changed ) urgent palanivel jayanthi ASP.NET 1.0 and 1.1 Professional 1 March 12th, 2007 05:32 PM
export excel file ( format is changed ) urgent palanivel jayanthi ASP.NET 1.0 and 1.1 Basics 1 March 12th, 2007 05:31 PM
excel export msrnivas .NET Web Services 1 March 29th, 2004 03:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.