Any guidelines that able to print customize a page with custom header and data passing?
I found a solution, but that is print the repeater/gridview without customize the page..
What i need is print a page with customization.
The Red Cross indicates to remove while in print preview.
Auto Landscape if neccessary.
Thanks for in advanced.
protected void Print(object sender, EventArgs e)
{
rptView.DataBind();
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
rptView.RenderControl(hw);
string gridHTML = sw.ToString().Replace("\"", "'")
.Replace(System.Environment.NewLine, "");
StringBuilder sb = new StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.print();");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "GridPrint", sb.ToString());
rptView.DataBind();
}