This commit is contained in:
2021-12-28 19:01:28 +00:00
parent b6e4878269
commit 9085b6e88d
6 changed files with 114 additions and 100 deletions

View File

@@ -639,38 +639,38 @@ export default {
PDFTime: window.$gz.locale.utcDateToShortTimeLocalized(nowUtc)
};
},
///////////////////////////////////
// RENDER REPORT DIRECTLY
//
//
async renderReport(objectid, reportid, redirectNotPopup) {
const reportDataOptions = {
ReportId: reportid,
SelectedRowIds: [objectid],
ClientMeta: this.reportClientMetaData()
};
// ///////////////////////////////////
// // RENDER REPORT DIRECTLY
// //
// //
// async renderReport(objectid, reportid, redirectNotPopup) {
// const reportDataOptions = {
// ReportId: reportid,
// SelectedRowIds: [objectid],
// ClientMeta: this.reportClientMetaData()
// };
const res = await window.$gz.api.upsert("report/render", reportDataOptions);
if (res.error) {
if (redirectNotPopup) {
return res;
} else {
throw new Error(window.$gz.errorHandler.errorToString(res));
}
} else {
const reportUrl = window.$gz.api.reportDownloadUrl(res.data);
if (redirectNotPopup) {
//used for direct report open from direct report view url
window.location.replace(reportUrl);
} else {
if (window.open(reportUrl, "Report") == null) {
throw new Error(
"Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
);
}
}
}
},
// const res = await window.$gz.api.upsert("report/render", reportDataOptions);
// if (res.error) {
// if (redirectNotPopup) {
// return res;
// } else {
// throw new Error(window.$gz.errorHandler.errorToString(res));
// }
// } else {
// const reportUrl = window.$gz.api.reportDownloadUrl(res.data);
// if (redirectNotPopup) {
// //used for direct report open from direct report view url
// window.location.replace(reportUrl);
// } else {
// if (window.open(reportUrl, "Report") == null) {
// throw new Error(
// "Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting"
// );
// }
// }
// }
// },
///////////////////////////////////
// FETCH BIZ OBJECT NAME
//