The callback that is invoked before the export result request sent.
// ESM usage
import {exportReport} from './jsViewer.min.js';
exportReport({
callback: ()=>console.log('test')
});
// UMD usage
GrapeCity.ActiveReports.JSViewer.export({
callback: ()=>console.log('test')
});
The callback that is invoked when an error occurs in the process of displaying the report. The default error panel does not appear if the callback returns true. The error parameter is an object that has a message property which allows the users to customize the error message and details property which allows to customize error details.
// ESM usage
import { printReport } from './jsViewer.min.js';
printReport({
error: (error) => {
if (error.message) {
// show error message.
alert("Internal error! Please ask administrator.");
// do not show default error message.
}
}
}):
// ESM usage
import { printReport } from './jsViewer.min.js';
printReport({
error: (error) => {
if (error.message) {
// show error message.
return {message = "Custom message", caption = "Custom caption"};
}
}
}):
// UMD usage
GrapeCity.ActiveReports.JSViewer.print({
error: (error) => {
if (error.message) {
// show error message.
alert("Internal error! Please ask administrator.");
// do not show default error message.
}
}
}):
// UMD usage
GrapeCity.ActiveReports.JSViewer.print({
error: (error) => {
if (error.message) {
// show error message.
return {message = "Custom message", caption = "Custom caption"};
}
}
}):
The document format type to report be exported to.
// ESM usage
import {exportReport} from './jsViewer.min.js';
exportReport({
exportType: 'Pdf'
});
// UMD usage
GrapeCity.ActiveReports.JSViewer.export({
exportType: 'Pdf'
});
The id of the report to be shown by the JS Viewer.
// ESM usage
import { printReport } from './jsViewer.min.js';
printReport({
reportID: 'AnnualReport.rdlx'
}):
// UMD usage
GrapeCity.ActiveReports.JSViewer.print({
reportID: 'AnnualReport.rdlx'
}):
Optional
reportThe array of the {name, value} pairs that describe the parameters values used to run the report.
// ESM usage
import { printReport } from './jsViewer.min.js';
printReport({
reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
}):
// UMD usage
GrapeCity.ActiveReports.JSViewer.print({
reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
}):
Optional
reportSet up the settings to connect the Web API.
// ESM usage
import { printReport } from './jsViewer.min.js';
printReport({
reportService: {
url: 'http://example.com/api/reporting',
securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
}
}):
// UMD usage
GrapeCity.ActiveReports.JSViewer.print({
reportService: {
url: 'http://example.com/api/reporting',
securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
}
}):
Optional
save// ESM usage
import {exportReport} from './jsViewer.min.js';
exportReport({
saveAsDialog: true
});
// UMD usage
GrapeCity.ActiveReports.JSViewer.export({
saveAsDialog: true
});
Optional
settingsExport settings
// ESM usage
import {exportReport} from './jsViewer.min.js';
exportReport({
settings : {
EmbedFonts:'All',
Title:'MyInvoice'
}});
// UMD usage
GrapeCity.ActiveReports.JSViewer.export({
settings : {
EmbedFonts:'All',
Title:'MyInvoice'
}});
The following options can be set during initialization or at run time while working with the JS Viewer.