This commit is contained in:
2020-09-04 15:19:30 +00:00
parent aea0e6de09
commit 67eb78aa9f
2 changed files with 44 additions and 25 deletions

View File

@@ -81,8 +81,41 @@ export default {
}
});
},
renderReport(reportid) {
alert(`RENDER REPORT ${reportid}`);
async renderReport(reportId) {
let vm = this;
if (vm.$route.params.recordid == 0) {
return;
}
/*
public class RenderReportParameter
{
public long ReportId { get; set; }
public long[] SelectedRowIds { get; set; }
public string DataListKey { get; set; }
public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
}
*/
let reportDataOptions = vm.reportDataOptions;
if (!reportDataOptions) {
throw "Missing report data unable to render report";
}
reportDataOptions.ReportId = reportId;
let url = "report/render";
let res = await window.$gz.api.upsert(url, reportDataOptions);
if (res.error) {
throw res.error;
} else {
let reportUrl = window.$gz.api.reportDownloadUrl(res.data);
//console.log("Report url:", reportUrl);
if (window.open(reportUrl, "Report") == null) {
throw "Problem displaying report in new window. Browser must allow pop-ups to view reports; check your browser setting";
}
}
this.isVisible = false;
this.resolve(null);
},
async open(reportDataOptions) {
let vm = this;