I am exporting a data table to Excel, but my row height get wildly large, how can this be changed to actually set the row height?
publicvoid ExportToExcel(DataTable dataTable)
{
string filename = "Report.xls";
StringWriter tw = new System.IO.StringWriter();
HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
DataGrid dgGrid = new DataGrid();
dgGrid.DataSource = dataTable;
dgGrid.DataBind();
dgGrid.RenderControl(hw);
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");
HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End();
}