Hi,
I have a gridview with a image and my image or image path is not storing in db. Its common for all pages.
So how to export gridview with image to excel .
I searched i am getting solution that images are stored in db.
Below is my aspx code.
CS Code for exporting:
protected void btnwexport_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=WeeklyECGReport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter hw = new HtmlTextWriter(sw);
//To Export all pages
//grddaily.AllowPaging = false;
this.fillgrid();
grdweekly.HeaderRow.BackColor = Color.White;
foreach (TableCell cell in grdweekly.HeaderRow.Cells)
{
cell.Width = 140;
cell.Height = 190;
break;
}
grdweekly.RenderControl(hw);
//style to format numbers to string
string style = @"";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
}
}
Pls Help me.. Its very urgent.
Priya BmPosted Aug 25, 2015, 1:18 AM
Yashwanth MuthineniPosted Aug 25, 2015, 12:59 AM