From 3d18be0025613fd8bd009c29f01aea5ca082103c Mon Sep 17 00:00:00 2001 From: Andre Loreth <a.loreth@adito.de> Date: Tue, 18 Feb 2020 11:17:11 +0100 Subject: [PATCH] #1051579: Report_lib: Add default values for #exportReport(...) --- neonContext/Offer/Offer.aod | 4 ++++ process/Report_lib/process.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/neonContext/Offer/Offer.aod b/neonContext/Offer/Offer.aod index 2fd951b69ce..2a823d8bf9e 100644 --- a/neonContext/Offer/Offer.aod +++ b/neonContext/Offer/Offer.aod @@ -35,5 +35,9 @@ <name>d72d1eb1-461c-442c-881d-48fb71b89316</name> <view>OfferDrawer_view</view> </neonViewReference> + <neonViewReference> + <name>02938f44-bc24-4542-916b-8db5d1976b40</name> + <view>OfferReport_view</view> + </neonViewReference> </references> </neonContext> diff --git a/process/Report_lib/process.js b/process/Report_lib/process.js index af40b179198..a41b4175750 100644 --- a/process/Report_lib/process.js +++ b/process/Report_lib/process.js @@ -179,15 +179,18 @@ Report.prototype.setReportData = function(pReportData) { * Export the report * @param {String} pFilename * @param {Array} pCondition a sql-condition (can also be a prepared condition) - * @param {Number} pExportFormat the export format. e.g. report.REPORT_EXPORT_PDF + * @param {Number} pExportFormat the export format. e.g. report.REPORT_EXPORT_PDF. Defaults to PDF. * @param {String} pWhereOrder see documentation for report.exportToBytes() * @param {String} pLanguage * * @return {Array} [filename, data_bytes] */ Report.prototype.exportReport = function(pFilename, pCondition, pExportFormat, pWhereOrder, pLanguage) { + if (pFilename == undefined) pFilename = ""; if (pCondition == undefined) pCondition = ""; + if (pExportFormat == undefined) pExportFormat = report.REPORT_EXPORT_PDF; if (pWhereOrder == undefined) pWhereOrder = null; + if (pLanguage == undefined) pLanguage = null; var doc = [pFilename, report.exportToBytes(this.reportName, pCondition, pExportFormat, pWhereOrder, this.reportParams, this._getReportDataFields(), this._getReportDataValues(), pLanguage)]; return doc; -- GitLab