|
@@ -57,7 +57,7 @@ function getAllPagesCommonOrg(rpt_id, pageSize, option, cb) {
|
|
|
let defProperties = rptUtil.getReportDefaultCache();
|
|
|
let dftOption = option||JV.PAGING_OPTION_NORMAL;
|
|
|
printCom.initialize(rptTpl);
|
|
|
- printCom.analyzeData(rptTpl, tplData, defProperties, dftOption);
|
|
|
+ printCom.analyzeData(rptTpl, tplData, defProperties, dftOption, JV.OUTPUT_TYPE_NORMAL);
|
|
|
let maxPages = printCom.totalPages;
|
|
|
let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties);
|
|
|
if (pageRst) {
|
|
@@ -223,7 +223,7 @@ function setupCustomizeCfg(customizeCfg, rptTpl, defProperties) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, option, cb) {
|
|
|
+function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, option, outputType, cb) {
|
|
|
let rptTpl = null;
|
|
|
rptTplFacade.getRptTemplate(rpt_id).then(function(rst) {
|
|
|
rptTpl = rst;
|
|
@@ -253,7 +253,7 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
|
|
|
if (customizeCfg) setupCustomizeCfg(customizeCfg, rptTpl, defProperties);
|
|
|
let dftOption = option||JV.PAGING_OPTION_NORMAL;
|
|
|
printCom.initialize(rptTpl);
|
|
|
- printCom.analyzeData(rptTpl, tplData, defProperties, dftOption);
|
|
|
+ printCom.analyzeData(rptTpl, tplData, defProperties, dftOption, outputType);
|
|
|
let maxPages = printCom.totalPages;
|
|
|
let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties, customizeCfg);
|
|
|
if (pageRst) {
|
|
@@ -298,7 +298,7 @@ function getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, custo
|
|
|
if (customizeCfg) setupCustomizeCfg(customizeCfg, rptTpl, defProperties);
|
|
|
let dftOption = option||JV.PAGING_OPTION_NORMAL;
|
|
|
printCom.initialize(rptTpl);
|
|
|
- printCom.analyzeData(rptTpl, tplData, defProperties, dftOption);
|
|
|
+ printCom.analyzeData(rptTpl, tplData, defProperties, dftOption, outputType);
|
|
|
let maxPages = printCom.totalPages;
|
|
|
let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties, customizeCfg);
|
|
|
if (pageRst) {
|
|
@@ -330,7 +330,7 @@ module.exports = {
|
|
|
;
|
|
|
// req.session.sessionUser.ssoId
|
|
|
let user_id = req.session.sessionUser.id;
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, null, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, null, JV.OUTPUT_TYPE_NORMAL, function (err, pageRst) {
|
|
|
callback(req, res, err, pageRst);
|
|
|
});
|
|
|
},
|
|
@@ -348,7 +348,7 @@ module.exports = {
|
|
|
for (let id of rpt_ids) {
|
|
|
parallelFunctions.push((function (rpt_id) {
|
|
|
return function (cb) {
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_NORMAL, function (err, pageRst) {
|
|
|
if(err){
|
|
|
cb(err);
|
|
|
}
|
|
@@ -377,7 +377,7 @@ module.exports = {
|
|
|
customizeCfg = params.custCfg
|
|
|
;
|
|
|
let user_id = req.session.sessionUser.id;
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, null, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, null, JV.OUTPUT_TYPE_SVG, function (err, pageRst) {
|
|
|
let svgRstStrArr = rpt_svg_util.exportSvgStr(pageRst, 0, 0);
|
|
|
callback(req, res, err, svgRstStrArr);
|
|
|
});
|
|
@@ -399,7 +399,7 @@ module.exports = {
|
|
|
let r_id = rpt_ids[idx];
|
|
|
parallelFunctions.push((function (rpt_id) {
|
|
|
return function (cb) {
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_EXCEL, function (err, pageRst) {
|
|
|
if(err){
|
|
|
cb(err);
|
|
|
}
|
|
@@ -440,7 +440,7 @@ module.exports = {
|
|
|
let r_name = rpt_names[idx];
|
|
|
parallelFunctions.push((function (rpt_id, rpt_name) {
|
|
|
return function (cb) {
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_EXCEL, function (err, pageRst) {
|
|
|
if(err){
|
|
|
cb(err);
|
|
|
} else {
|
|
@@ -495,7 +495,7 @@ module.exports = {
|
|
|
let customizeCfg = null;
|
|
|
let user_id = req.session.sessionUser.id;
|
|
|
let dftOption = option||JV.PAGING_OPTION_NORMAL;
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, function(err, pageRst){
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_EXCEL, function(err, pageRst){
|
|
|
try {
|
|
|
rpt_xl_util.exportExcel(pageRst, pageSize, rptName, isOneSheet, null, null, function(uuidName){
|
|
|
res.setHeader('Content-Type', 'application/vnd.openxmlformats');
|
|
@@ -526,7 +526,7 @@ module.exports = {
|
|
|
for (let id of rpt_ids) {
|
|
|
parallelFunctions.push((function (rpt_id) {
|
|
|
return function (cb) {
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, null, null, dftOption, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, null, null, dftOption, JV.OUTPUT_TYPE_EXCEL, function (err, pageRst) {
|
|
|
if(err){
|
|
|
cb(err);
|
|
|
}
|
|
@@ -573,7 +573,7 @@ module.exports = {
|
|
|
let r_name = rpt_names[idx];
|
|
|
parallelFunctions.push((function (rpt_id, rpt_name) {
|
|
|
return function (cb) {
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, function (err, pageRst) {
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, customizeCfg, dftOption, JV.OUTPUT_TYPE_PDF, function (err, pageRst) {
|
|
|
if(err){
|
|
|
cb(err);
|
|
|
}
|
|
@@ -604,7 +604,7 @@ module.exports = {
|
|
|
rptName = req.params.rptName
|
|
|
;
|
|
|
let user_id = req.session.sessionUser.id;
|
|
|
- getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, null, JV.PAGING_OPTION_NORMAL, function(err, pageRst){
|
|
|
+ getAllPagesCommon(user_id, prj_id, rpt_id, pageSize, orientation, null, JV.PAGING_OPTION_NORMAL, JV.OUTPUT_TYPE_PDF, function(err, pageRst){
|
|
|
rpt_pdf_util.export_pdf_file(pageRst, pageSize, rptName,function (uuidName) {
|
|
|
res.setHeader('Content-Type', 'application/vnd.openxmlformats');
|
|
|
// res.setHeader("Content-Disposition", "attachment; filename=" + strUtil.getPinYinCamelChars(rptName) + ".pdf");
|