<script type="text/javascript">
|
var staticUrl = '${base}';
|
</script>
|
<script language="javascript" src="${common_static}/static/plugins/print/LodopFuncs.js"></script>
|
<script type="text/javascript">
|
|
var LODOP; //声明为全局变量
|
|
//A4打印 type: 1=横向 2=纵向
|
function printA4(type,dom) {
|
LODOP=getLodop();
|
CreateOneFormPage(type,dom);
|
LODOP.PREVIEW();
|
};
|
|
|
|
function CreateOneFormPage(type,dom){
|
var strStyleCSS="<link href='${common_static}/static/ui/css/printa4-table.css' type='text/css' rel='stylesheet'>";
|
var strFormHtml=strStyleCSS+"<body>"+document.getElementById(dom).innerHTML+"</body>";
|
LODOP.SET_PRINT_PAGESIZE(type,0,0,"A4");
|
LODOP.SET_PRINT_STYLEA(1,"Angle",90);
|
LODOP.ADD_PRINT_HTM("1.0cm","0.5cm","RightMargin:0.9cm","BottomMargin:9mm",strFormHtml);
|
};
|
|
function exportXls(name){
|
LODOP=getLodop();
|
LODOP.PRINT_INIT("");
|
LODOP.ADD_PRINT_TABLE(100,20,500,80,document.documentElement.innerHTML);
|
LODOP.SET_SAVE_MODE("Orientation",2); //Excel文件的页面设置:横向打印 1-纵向,2-横向;
|
LODOP.SET_SAVE_MODE("PaperSize",9); //Excel文件的页面设置:纸张大小 9-对应A4
|
LODOP.SET_SAVE_MODE("Zoom",90); //Excel文件的页面设置:缩放比例
|
LODOP.SET_SAVE_MODE("CenterHorizontally",true);//Excel文件的页面设置:页面水平居中
|
LODOP.SET_SAVE_MODE("CenterVertically",true); //Excel文件的页面设置:页面垂直居中
|
LODOP.SAVE_TO_FILE(name+".xls");
|
}
|
|
function exportXlsById(id,name){
|
LODOP=getLodop();
|
LODOP.PRINT_INIT("");
|
LODOP.ADD_PRINT_TABLE(100,20,500,80,document.getElementById(id).innerHTML);
|
LODOP.SET_SAVE_MODE("Orientation",2); //Excel文件的页面设置:横向打印 1-纵向,2-横向;
|
LODOP.SET_SAVE_MODE("PaperSize",9); //Excel文件的页面设置:纸张大小 9-对应A4
|
LODOP.SET_SAVE_MODE("Zoom",90); //Excel文件的页面设置:缩放比例
|
LODOP.SET_SAVE_MODE("CenterHorizontally",true);//Excel文件的页面设置:页面水平居中
|
LODOP.SET_SAVE_MODE("CenterVertically",true); //Excel文件的页面设置:页面垂直居中
|
LODOP.SAVE_TO_FILE(name+".xls");
|
}
|
|
function onDialogBtnClick(btnID, dialogID, config){//此函数放在子页面
|
if(btnID == "btnExport"){
|
saveAsFile();
|
}
|
if(btnID == "btnPrint"){
|
prn1_preview();
|
}
|
}
|
</script>
|