When the ASP.net program involves data display when most will require printing, and the page on the print format is often not meet the needs of the often used method is to import into Excel and then print. (as if this is already a cliché) today on the Internet to search a piece of printed code, feel good, need to print friends can see.
Some of the code on the web is basically similar to the principle, there is also a problem, is:
The control "Ctl00_center_gridview1" of type "GridView" must be placed inside a form tag that has a runat=server. Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code. Exception Details: System.Web.HttpException: The control "ctl00_center_gridview1" of the type "GridView" must be placed inside a form tag with Runat=server.
The error description is that I'm commenting that this procedure is a false quote,
//public override void VerifyRenderingInServerForm(Control control)
//{
// //base.VerifyRenderingInServerForm (control);
//}