---testATGridPrint.aspx
<html>
<head>
<title>New Page 1 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<p align="center">
<OBJECT id="ATGrid1" height="480" ;680" classid="clsid:D0CB6A0C-E656-4BF4-BD2D-6AE5EC183D7C">
<PARAM NAME="FileName" VALUE="CaiGouDingDan1.eT">
<PARAM NAME="BackColor" VALUE="#ffe7dd">
<PARAM NAME="Border3D" VALUE="FALSE">
<PARAM NAME="Ruler" VALUE="FALSE">
<PARAM NAME="DataSource" VALUE="importData3.aspx">
</OBJECT>
</p>
<p align="center">
<input type='button' value='打印预览' οnclick='javascript:printPreviewRpt();'>
<input type='button' value='打印一份' οnclick='javascript:printRpt();'>
<input type='button' value='连续打印' οnclick='javascript:printRpt10();'>
</p>
<script language="JavaScript">
function PrintSetup()
{
var strXML;
strXML = " <?xml version='1.0' encoding='gb2312'?>";
strXML =" <EtCell>";
strXML =" <ETPrint>";
strXML =" <PaperSize value='DMPAPER_USER' depth='cm' '11' Height='8' />";
strXML =" <PrintFullPage value='true' /> ";
strXML =" </ETPrint>";
strXML =" </EtCell>";
//设置打印选项
ATGrid1.ImportXML(strXML);
}
function printPreviewRpt()
{
PrintSetup();
ATGrid1.PrintPreview();
}
function printRpt()
{
//下面导入数据
/*
ATGrid1.OpenDoc(xxx.et);
ATGrid1.ImportXML(url?参数);
ATGrid1.Print(false);
*/
PrintSetup();//设置纸张大小
ATGrid1.Print(false);
}
function printRpt10()
{
//循环打印10份
for(ii=0;ii <10;ii )
{
printRpt();
}
}
&lt;/SCRIPT>
</body>
</html>