Posted 12 August 2024, 5:03 am EST - Updated 12 August 2024, 11:15 am EST
Good morning,
I am using your activereportsnet-viewer version 18.1.1 (see here: https://www.npmjs.com/package/@mescius/activereportsnet-viewer), and I am defining the JSViewer like so:
_scope.viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#viewerContainer',
reportService: {
url: `${_scope.reportAPIEndPoint}api/reporting`,
securityToken: bearerToken
},
availableExports: ['Xml', 'Pdf'],
displayMode: 'single'
});
with a custom toolbar action to print defined like so:
_scope.viewer.toolbar.desktop.addItem({
key: '$print',
iconCssClass: 'fas fa-print',
enabled: true,
action: function (item) {
_scope.viewer.print();
}
});
When clicking the print button the securityToken defined in the viewer reportService is not passed to the /api/reporting/export/* endpoint (resulting in a 401 unauthorised), however if for example I call the export to PDF action (as below) it does pass the securityToken in the Authorization header of the HTTP call:
_scope.viewer.toolbar.desktop.addItem({
key: '$pdfExportButtonKey',
iconCssClass: 'fas fa-file-pdf',
enabled: true,
action: function (item) {
var exportConfig = {}; // Default settings
_scope.viewer.export('Pdf', undefined, true, exportConfig);
}
});
From what I can tell this appears to be an obvious bug, which is affecting our production environment now that we have turned on authorisation for our reporting API. Can you please raise this issue with your development team and in the meantime provide a work-around for this issue? I would rather not disable the authentication layer as this appears to be the only issue affecting us regarding it.