I am trying to add Export excel functionality
Exported excel from data set
Export excel from dataset. Excel exported with whole data and corresponding headers.But Styling to excelnot working.
How it make possible
Anyone pls hel me
The code given below:
public void ExportTableData(DataTable dtdata, String fs)
{
try
{
string attach = "attachment;filename=" + fs;
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", attach);
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
if (dtdata != null)
{
foreach (DataColumn dc in dtdata.Columns)
{
HttpContext.Current.Response.Write(dc.ColumnName + "\t");
}
HttpContext.Current.Response.Write(System.Environment.NewLine);
foreach (DataRow dr in dtdata.Rows)
{
for (int i = 0; i < dtdata.Columns.Co ...
Go to the complete details ...