0

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.
36e1d0310329124ba8fce2070ac095ff

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();
        }
3
Contributors
4
Replies
18
Views
3 Years
Discussion Span
Last Post by gahhon
0

Have you tried to further customize the look and feel of the page for printing using CSS Media Types, @media print? You can then provide customized values for properties and/or display: none to those elements you do not want included in the print.

Edited by JorgeM

0

The photo of previous post, is the printpreview of the entire page, but i only need capture the information of gridview, repeater, chart, grandtotal if any.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.