Hi There;
I want to print a dataset result into an Excel file. Here is the source code :
protected void btnExcel_Click(object sender, EventArgs e)
{ Dataset ds = new Dataset(); //Dataset is filled here. I am sure.
ExportDataSetToExcel(ds);
}
private void ExportDataSetToExcel(DataSet ds)
{
string filename = cmbIlSorgu.Text + "_Report.xlsx";
GridView gridview1 = new GridView();
gridview1.DataSource = ds;
gridview1.DataBind();
Export(filename, gridview1);
}
public static void Export(string fileName, GridView gv)
{
int numberOfRows = 0;
bool debugMode = false;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader(
"content-disposition", string.Fo ...
Go to the complete details ...