Reference content is as follows: <Html> <Head> <Title> ScriptX printing </title> <Meta name = "GENERATOR" Content = "Microsoft Visual Studio. NET 7.1"> <Meta name = "CODE_LANGUAGE" Content = "C #"> <Meta name = "vs_defaultClientScript" content = "JavaScript"> <Meta http-equiv = "content-type" content = "text/html; charset = gb2312"> <Meta name = "vs_targetSchema" content = "http://schemas.microsoft.com/intellisense/ie5"> <Link href = "kg.css" rel = "stylesheet" type = "text/css"> <Link href = "print.css" rel = "stylesheet" type = "text/css" media = "print"> <Script FOR = document event = "onclick"> If (event. srcElement. tagName = 'A '){ // Alert ('a click! '); Event. cancelBubble = true; } </Script>
<Style type = "text/css"> A: link {text-decoration: none} A: visited {text-decoration: none} A: active {text-decoration: none} A: hover {text-decoration: none} A {COLOR: #000000; TEXT-DECORATION: none; FONT-SIZE: 8pt; FONT-FAMILY :"";} </Style> </Head>
<Body MS_POSITIONING = "GridLayout"> <〈! -- Call the control ScriptX. cab --> <Object id = "factory" viewastext style = "display: none" Classid = "clsid: 1663ed61-23eb-11d2-b92f-008048fdd814" Codebase = "ScriptX. cab # Version = 6, 1, 431,2"> </Object> <SCRIPT defer> // Set print Parameters Function printBase (){ Factory. printing. footer = "& B ScriptX Print & B" // Header Factory. printing. footer = "" // footer Factory. printing. portrait = <%= orientation %> // true indicates vertical printing, and flase indicates horizontal printing. Factory. printing. leftMargin = 1.5 // left margin Factory. printing. topMargin = 0.5 // top margin Factory. printing. rightMargin = 0.5 // right margin Factory. printing. bottomMargin = 1.0 // bottom margin } </SCRIPT> <Table width = "100%" border = "0" cellspacing = "0" cellpadding = "0" align = "center" bordercolor = "# FFFFFF"> <Tr bordercolor = "# FFFFFF"> <Td> <Table width = "70%" border = "0" cellspacing = "0" cellpadding = "2" align = "center"> <Tr> <Td align = "center"> <font size = "5" face = ""> <B> <div name = "divTitle" id = "divTitle"> </div> </B> </font> </td> </Tr> <Tr> <Td align = "center"> <Div id = "divReport" name = "divReport"> <Input type = "button" name = "Export print" id = "Export print" onclick = "printReport ()" value = "print">
<Input type = "button" onclick = "window. close ();" value = "close"> </Div> </Td> </Tr> </Table> </Td> </Tr> </Table> <Table width = "100%" border = "0" cellspacing = "0" cellpadding = "2" align = "center"> <Tr> <td align = "center"> <〈! -- Used to display the divTableContainer tag value --> <Div id = "divTableContainer" name = "divTableContainer"> </div> </Td> </tr> <Tr> <td align = "center"> <〈! -- Used to display the divChartContainer tag value --> <Div id = "divChartContainer" name = "divChartContainer"> </div> </Td> </tr> </Table> </Body> <Script language = "javascript"> // Maximize the interface MaxWin (); Var needcon = ''; Document. all. divTitle. innerText = unescape ('<%= title %> '); // The divTableResult and divChartResult labels of the parent form are transferred to the divTableContainer and divChartContainer labels respectively. Var tableContent = too many opener.doc ument. all. divTableResult. innerHTML; TableContent = replaceAll (tableContent, "<A", "<span "); TableContent = replaceAll (tableContent, "</A>", "</span> "); TableContent = replaceAll (tableContent, "<a", "<span "); TableContent = replaceAll (tableContent, "</a>", "</span> "); TableContent = replaceAll (tableContent, "<input", "<font "); TableContent = replaceAll (tableContent, "<INPUT", "<font "); Document. all. divTableContainer. innerHTML = tableContent; Document. all. divChartContainer. innerHTML = too many opener.doc ument. all. divChartResult. innerHTML; // Call the method for setting print parameters and display the preview Interface Function printReport (){ PrintBase (); // Window. print (); Factory. printing. Preview (); } Function replaceAll (str, from, ){ Var idx = str. indexOf (from ); While (idx>-1 ){ Str = str. replace (from, ); Idx = str. indexOf (from ); } Return str; } Function maxWin () { Var aw = screen. availWidth; Var ah = screen. availHeight; Window. moveTo (0, 0 ); Window. resizeTo (aw, ah ); } </Script> </Html> |