你好,你试试这个代码看看,看看自己添加的导出PDF的按钮能不能正常实现该功能<script type="text/javascript">
let viewer;
function loadViewer() {
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#viewerContainer',
reportID: 'Sqlserver多值参数报表1.rdlx',
//reportParameters: [{ name: 'P1', values: [1,2,3] }
//],
reportService: {},
setting: {
ZoomType: 'fitpage'
}
});
pdfExportButton = {
key: 'pdfExternalExportButton',
iconCssClass: 'mdi mdi-file',
text: "PDF Export",
title: "PDF Export",
checked: true,
enabled: true,
action: function (item) {
var settings = { title: 'Invoice List', userPassword: 'user_Pwd' };
var cancelCallback = function () {
return false;
}
viewer.export('pdf', settings, { cancel: cancelCallback })
.then(result => result.download("Exported_PDF"));
}
};
viewer.toolbar.desktop.addItem(pdfExportButton);
}
</script>
|