1. 概述
注:不支援行動端。
config:{
printUrl : String,//需要列印的範本的應用地址和服務
isPopUp : boolean, // 是否彈出設定視窗,true為彈出,false為不彈出
data :{
[{reportlet:String, parameterN: any},{},{}...]
}, // 需要列印的範本列表
printType : Number, // 列印型別,0為零用戶端列印,1為本地列印
// 以下為零用戶端列印的參數,僅當 printType 為 0 時生效
ieQuietPrint : Boolean,// IE靜默列印設定 true為靜默,false為不靜默
// 以下為本地列印的參數,僅當 printType 為 1 時生效
printerName : String, // 列印機名
pageType: Number, // 列印頁碼型別:0:所有頁,1:當前頁,2:指定頁
pageIndex: String, // 頁碼範圍。當 pageType 為 2 時有效
copy: Number, // 列印份數
};
2. 參數說明
參數 | |
---|---|
是否彈出設定視窗: | |
下面的參數為零用戶端列印的參數,僅當 printType 為 0 時生效 | |
下面的參數為本地列印的參數,僅當 printType 為 1 時生效 | |
3. 範例
http://localhost:8075/webroot/decision/view/report
var printurl="http://localhost:8075/webroot/decision/view/report";
var reportlets ="[{reportlet: 'GettingStartedTW.cpt', 地區: '華北'}, {reportlet: 'GettingStartedTW.cpt', 地區: '華東'}]";
var config = {
printUrl : printurl,
isPopUp : true,
// 是否彈出設定視窗,true為彈出,false為不彈出
data :{
// 多範本格式: [{reportlet: 'name.cpt', a: 'a1'}, {reportlet: 'name.cpt', b: 'b1'}] 同樣的範本會出現多頁
// 單範本格式: [{reportlet: 'name.cpt', a: 'a1', b: 'b1'}] 同樣的範本只會有單頁
reportlets: reportlets // 需要列印的範本列表
},
printType : 1, // 列印型別,0為零用戶端列印,1為本地列印
// 以下為零用戶端列印的參數,僅當 printType 為 0 時生效
ieQuietPrint : false,// IE靜默列印設定 true為靜默,false為不靜默
// 以下為本地列印的參數,僅當 printType 為 1 時生效
printerName : 'Microsoft Print to PDF', // 列印機名
pageType: 2, // 列印頁碼型別:0:所有頁,1:當前頁,2:指定頁
pageIndex: '1-3', // 頁碼範圍。當 pageType 為 2 時有效
copy: 3, // 列印份數
};
FR.doURLPrint(config);