Author: mattathodi | Posted on: 4/3/2010 2:18:21 AM | Views : 276

hi
iam using following code to export gridview to excel..but the generated excel file does not contain rows and columns and normal excel file ...
can any on e suggest a solutio for that
here is my code


StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            String savefile = heading;
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
            HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + savefile + ".xls");
    &nb ...

Go to the complete details ...