How to print data in the gridview

Source: Internet
Author: User
Gridview printing method

<HTML>
<Head>
<Title> my curriculum </title>
<Script language = JavaScript>
Function printsetup ()
{
// Print page settings
Wb.exe CWB (8, 1 );
}
Function printpreview ()
{
VaR HT1 = Document. getelementbyid ("H ");
Ht1.style. Display = "NONE"; // hide a part that does not need to be printed. This hidden part is only valid in the preview. CSS control is used for actual printing.
Wb.exe CWB (7,1); // print the Page Preview
Ht1.style. Display = ""; // display the hidden part After previewing.
}

Function printit ()
{
If (confirm ('Are you sure you want to print? '))
{
Wb.exe CWB (6, 6 );
}
}
</SCRIPT>
<Style type = "text/CSS" Media = print>
. Noprint {display: None} // do not print
</Style>
</Head>
<Body>
<! -- Content in Div H is not printed -->
<Div id = "H" align = center class = "noprint">
<Object ID = WB Height = 0 width = 0 classid = CLSID: 8856f961-340a-11d0-a96b-00c04fd705a2> </Object>
<Input onclick = javascript: printit () type = button value = print/>
<Input onclick = javascript: printsetup (); type = button value = print page settings/>
<Input onclick = javascript: printpreview (); type = button value = print preview/>
<Br> alkdjflkasdjflkajdflkadjiouepirulksjdfkj is not displayed during preview </BR>
</Div>
It can be displayed in Page Preview.
Body to print
</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.