Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Change Default Chart place in .xls format excel in asp.net
User77
8y
308
1
Reply
I am displaying chart above image it hides grid view control and i need to display below image how can i do this.
My code export code is:
protected void btnExport_Click(object sender, EventArgs e)
{
string imgPath2 = Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/" + tmpChartName);
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "MediCountReport.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
string headerTable = @"<Table><tr><td><img src='" + imgPath2 + @"' \></td></tr></Table>";
Response.Write(headerTable);
Response.Cache.SetCacheability(HttpCacheability.NoCache);
GridView1.AllowPaging = false;
BindGridview();
GridView1.HeaderRow.Style.Add("background-color", "#F5FFFA");
for (int i = 0; i < GridView1.HeaderRow.Cells.Count; i++)
{
GridView1.HeaderRow.Cells[i].Style.Add("background-color", "#DCDCDC");
}
GridView1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
Please help me out.
Thank you
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Web Page Error in javascript function
Gallery with album