TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
User77
NA
52
27.4k
Change Default Chart place in .xls format excel in asp.net
Nov 3 2016 6:59 AM
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
Reply
Answers (
1
)
How to add autogenerated column i.e Sr.No in mvc grid in mvc
Gallery with album