Js Viewer provides several options for printing a report. This topic describes several ways in which a report can be printed in Js Viewer.
Print report when the report is completely loaded in the viewer, using print() method.
index.html |
Copy Code
|
---|---|
var viewer; function loadViewer() { viewer = GrapeCity.ActiveReports.JSViewer.create({ element: '#viewerContainer', reportID: 'Report.rdlx', documentLoaded: () => viewer.print() }); } |
index.html |
Copy Code
|
---|---|
GrapeCity.ActiveReports.JSViewer.print({ reportID:'Report.rdlx'});
|
Open the report and export it to PDF with PrintOnOpen parameter set to 'true'. In this case, the exported PDF opens in new window of the browser, and the print dialog is displayed.
index.html |
Copy Code
|
---|---|
var viewer; function loadViewer() { viewer = GrapeCity.ActiveReports.JSViewer.create({ element: '#viewerContainer', reportID: 'Report.rdlx', documentLoaded: () => viewer.export('Pdf', null, true, { PrintOnOpen: 'true' }) }); } |
index.html |
Copy Code
|
---|---|
GrapeCity.ActiveReports.JSViewer.export({ reportID: 'Report.rdlx', exportType: 'Pdf', settings: { PrintOnOpen: 'true' }, callback: (args) => { window.open(args) } }) |
Note: