Posted 13 April 2020, 1:58 pm EST
Hi,
I have an application with reports loading using the ar-viewer and ActiveReports 14 and .NET Core. I am trying to add an export to PDF button to the toolbar, but review errors that the ```
viewer.toolbar.addItem
My process:
* "Download ar-viewer using ```
npm i @grapecity/ar-viewer
``` (14.0.1980 version) "
* "Setup app using these instructions https://www.grapecity.com/activereports/docs/v14/online/viewing-reports-using-js-viewer.html"
* "Using example and instructions to add a toolbar item from here https://www.grapecity.com/activereports/docs/v14/online/using-js-viewer.html"
Sample code (removed surrounding code for brevity):
import “@grapecity/ar-viewer/dist/jsViewer.min.js”;
import “@grapecity/ar-viewer/dist/jsViewer.min.css”;
UpdateDS() {
const pdfExportButton = {
key: ‘$pdfExportButtonKey’,
iconCssClass: ‘mdi mdi-file-pdf’,
enabled: true,
action: function (item) {
console.log(‘Export to PDF function works here’);
},
onUpdate: function (arg, item) {
console.log(‘Something in viewer was updated, check/update button state here’);
}
};
let url =
${process.env.REACT_APP_WEBAPI_URL}/api/reporting
;
// eslint-disable-next-line no-undef var viewer = GrapeCity.ActiveReports.JSViewer.create({ element: '#client-report', reportService: { url: url, securityToken: authHeader().Authorization }, availableExports: ['Csv', 'Pdf', 'Xlsx'], }); viewer.toolbar.addItem(pdfExportButton); viewer.openReport('clients.rdlx'); }
If I take out ```
viewer.toolbar.addItem(pdfExportButton), the report renders perfectly!
Can you help me understand why many methods are missing from the runtime that are described in the documentation?
Here is a snapshot of the debugger: [img]https://gccontent.blob.core.windows.net/forum-uploads/file-34bde218-7211-45d7-8f9e-5021f83c2edd.jpg[/img]