<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>调用WebBrowser组件实现打印功能</title>
    <style type="text/css">
        .style1
        {
            font-family: 微软雅黑;
            font-size: xx-large;
            color: #008080;
            font-weight: bold;
        }
    </style>
<script language="javascript" >
function Button1_onclick()
 {
    document.all.WebBrowser.ExecWB(6,1);
 }

function Button2_onclick() 
{
   document.all.WebBrowser.ExecWB(6,6);
}

function Button3_onclick() 
{
   document.all.WebBrowser.ExecWB(8,1);
}

function Button4_onclick() 
{
   document.all.WebBrowser.ExecWB(7,1)
}

function Button5_onclick() 
{
    window.close()
}
function Button1_onclick() {
document.all.WebBrowser.ExecWB(6,1);
}

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table align="center" style="width: 580px;">
            <tr>
                <td align="center" class="style1" >
                    调用WebBrowser组件实现打印功能<br />
                </td>
            </tr>
            <tr>
                <td>
                    <span style="font-size:10.5pt;mso-bidi-font-size:10.0pt;
font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&nbsp;&nbsp;&nbsp;
                    <br />
&nbsp;&nbsp;&nbsp; 水晶报表以其简单、易用和强大的功能倍受编程人员的喜爱。数据源的选定是设计水晶报表的关键，水晶报表的数据源可以是<span lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">SQL Server</span><span style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA">、</span><span lang="EN-US" style="font-size:10.5pt;
mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA">Excel</span><span style="font-size:10.5pt;mso-bidi-font-size:
10.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">、</span><span 
                        lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">Access</span><span style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA">、</span><span lang="EN-US" style="font-size:10.5pt;
mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;mso-fareast-font-family:
宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;
mso-bidi-language:AR-SA">DB2</span><span style="font-size:10.5pt;mso-bidi-font-size:
10.0pt;font-family:宋体;mso-ascii-font-family:&quot;Times New Roman&quot;;mso-hansi-font-family:
&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">等。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <img alt="" src="1599.jpg" style="height: 135px; width: 155px" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <br />
&nbsp;&nbsp;&nbsp; 本案例是以</span><span lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">Access</span><span style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA">数据库作为水晶报表的数据源，从中提取需要显示的字段数据。注意，在选择数据库文件时，要选取以</span><span 
                        lang="EN-US" style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:&quot;Times New Roman&quot;;
mso-fareast-font-family:宋体;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;
mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">.mdb</span><span style="font-size:10.5pt;mso-bidi-font-size:10.0pt;font-family:宋体;mso-ascii-font-family:
&quot;Times New Roman&quot;;mso-hansi-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:
&quot;Times New Roman&quot;;mso-font-kerning:1.0pt;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA">格式文件结尾的数据库文件</span></span></td>
                <object id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
                </object>
            </tr>
            <tr>
                <td align="center">
                    <br />
                    <input id="Button1" type="button" value=" 打 印 " onclick="return Button1_onclick()" onclick="return Button1_onclick()" />&nbsp;
                    <input id="Button2" type="button" value="直接打印" onclick="return Button2_onclick()" />&nbsp;&nbsp;
                    <input id="Button3" type="button" value="页面设置" onclick="return Button3_onclick()" />&nbsp;&nbsp;
                    <input id="Button4" type="button" value="打印预览" onclick="return Button4_onclick()" />&nbsp;&nbsp;&nbsp;
                    <input id="Button5" type="button" value=" 关 闭 " onclick="return Button5_onclick()" /></td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
