Asp.Net Hein

Asp.Net Hein

  • NA
  • 266
  • 159k

How to delete

May 12 2015 11:05 PM
Hello everybody,
   I have already print out the document... But now I have some problems. In printed document, there is file name and page no. and date time.
   Now I want to remove all these (1) File name (2) Page no. (3) Date time.
   Can anyone help me how to remove those things.
   Thanks a lot for viewing my post. 
 
My code
 
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
grvid.RenderControl(hw);
string gridHTML = sw.ToString().Replace("\"", "'")
.Replace(System.Environment.NewLine, "");
StringBuilder sb = new StringBuilder();
gridHTML.Remove(0);
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload = new function(){");
sb.Append("var printWin = window.open('', '', 'left=0");
sb.Append(",top=0,width=700,height=300,status=0');");
sb.Append("printWin.document.write(\"");
sb.Append(gridHTML);
sb.Append("\");");
sb.Append("printWin.document.close();");
sb.Append("printWin.focus();");
sb.Append("printWin.print();");
sb.Append("printWin.close();};");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "GridPrint", sb.ToString());
 

Answers (1)