Optional
actionThe callback that is invoked before the JS Viewer opens the hyperlink, bookmark link, drill down report or toggles the report control visibility.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
});
Optional
animationThe report view animation options.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
animation: {
loadChart: {
enabled: true
},
hoverChart: {
enabled: true
},
hoverTable: {
enabled: true,
backgroundColor: 'LightGray',
textColor: 'DarkGray'
}
}
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
animation: {
loadChart: {
enabled: true
},
hoverChart: {
enabled: true
},
hoverTable: {
enabled: true,
backgroundColor: 'LightGray',
textColor: 'DarkGray'
}
}
});
Optional
autoWhen true, view area background color is filled with report body color available only for dashboard reports
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
autoBackgroundColor : true;
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
autoBackgroundColor : true;
});
Optional
availableThe array of export types available via Export functionality of JS Viewer. By default, Mht, Pdf, Tiff, Xls, Xlsx, Csv, Doc, Docx, Json, Xml, TextPrint, XlsxData and CsvData exports are available for page reports, Mht, Pdf, Tiff, Xls, Xlsx, Rtf and Txt exports are available for section reports.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
availableExports: ['Xml', 'Pdf']
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
availableExports: ['Xml', 'Pdf']
});
Optional
defaultThe object containing custom default export settings. Use to set default value and visibility of any field in the export panel. Format keys are mht, pdf, tiff, xls, xlsx, csv, doc, docx, json, xml, xlsxData, csvData, rtf and txt. Settings' keys are the export settings which are available for RenderingExtensions.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
defaultExportSettings: {
xls: {
FileName: {
value: "Hihihi",
visible: false
}
}
}
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
defaultExportSettings: {
xls: {
FileName: {
value: "Hihihi",
visible: false
}
}
}
});
Optional
displaySet up single page or continuous page.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
displayMode: 'Continuous'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
displayMode: 'Continuous'
});
Optional
documentThe callback that is invoked when a document is loaded entirely on the server.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
documentLoaded: () => console.log('The document is loaded entirely on the server')
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
documentLoaded: () => console.log('The document is loaded entirely on the server')
});
JQuery selector that specifies the element that hosts the JS Viewer control.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#viewerContainer'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#viewerContainer'
});
Optional
errorThe 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 doesn't reurn proper object. The error parameter is an object that has a message property which allows the users to customize the error message and caption property which allows to customize error caption.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
error: (error) => {
if (error.message) {
// show error message.
alert("Internal error! Please ask administrator.");
// do not show default error message.
return true;
}
}
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
error: (error) => {
if (error.message) {
// show error message.
alert("Internal error! Please ask administrator.");
// do not show default error message.
return true;
}
}
});
Optional
initialSet up the initial zoom mode.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
initialZoomMode: 'FitToWidth';
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
initialZoomMode: 'FitToWidth';
});
Optional
localeSpecifies locale used for displaying Viewer. If locale is not specified explicitly here, the locale corresponding to the browser preferences is used.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
locale: 'ja-JP'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
locale: 'ja-JP'
});
Optional
localeThe JSON containing the localization strings. Not all strings are necessary — missing values will be displayed using EN localization data.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
localeData: JSON.parse( `{
"export": {
"boolTextFalse": "Нет",
"boolTextTrue": "Да"
},
"viewer": {
"toolbar": {
"refresh": "Обновить"
}
}
}`
)
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
localeData: JSON.parse( `{
"export": {
"boolTextFalse": "Нет",
"boolTextTrue": "Да"
},
"viewer": {
"toolbar": {
"refresh": "Обновить"
}
}
}`
)
});
Optional
localeThe url of the file containing the localization strings. Not all strings are necessary — missing values will be displayed using EN localization data.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
localeUri: './locale.json'
});
locale.json:
{
"export": {
"boolTextFalse": "Нет",
"boolTextTrue": "Да",
...
},
"exportcsv": {
"friendlyName": "-CSV-",
"settings": {
"ColumnsDelimiter": {
"label": "Разделитель Столбцов",
"category": "Прочее"
},
...
},
...
},
...
}
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
localeUri: './locale.json'
});
locale.json:
{
"export": {
"boolTextFalse": "Нет",
"boolTextTrue": "Да",
...
},
"exportcsv": {
"friendlyName": "-CSV-",
"settings": {
"ColumnsDelimiter": {
"label": "Разделитель Столбцов",
"category": "Прочее"
},
...
},
...
},
...
}
Optional
pageDefines horizontal alignment and view for report page like part of the WebPage or 'paper view'
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
pageView: {
horizontalAlignment: 'left',
viewMode: 'standard'
}
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
pageView: {
horizontalAlignment: 'left',
viewMode: 'standard'
}
});
Optional
panelsThe position of panels (search, parameters etc): 'toolbar' or 'sidebar'. Default value is 'toolbar'.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
panelsLocation: 'sidebar'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
panelsLocation: 'sidebar'
});
Optional
parametersSet up the parameters panel settings.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
parametersPanel: {
* location: 'top',
* open: 'always'
}});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
parametersPanel: {
* location: 'top',
* open: 'always'
}});
Optional
renderSet up render mode: 'auto', 'html' or 'svg'
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
renderFormat : 'auto'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
renderFormat : 'auto'
});
Optional
renderSet up initial render mode: 'Paginated' or 'Galley'. Default value is 'Paginated'.
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
renderMode: 'Galley'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
renderMode: 'Galley'
});
Optional
reportIDThe id of the report to be shown by the JS Viewer.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
reportID: 'AnnualReport.rdlx'
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
reportID: 'AnnualReport.rdlx'
});
Optional
reportThe callback that is invoked when the JS Viewer obtains the information about the requested report.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
reportLoaded: (reportInfo) => console.log('The report ' + reportInfo.name + ' was successfully loaded!')
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
reportLoaded: (reportInfo) => console.log('The report ' + reportInfo.name + ' was successfully loaded!')
});
Optional
reportThe array of the {name, value} pairs that describe the parameters values used to run the report.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
});
Optional
reportSet up the settings to connect the Web API.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
reportService: {
url: 'http://example.com/api/reporting',
securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
}
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
reportService: {
url: 'http://example.com/api/reporting',
securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
}
});
Optional
silentJQuery selector that specifies the element that hosts the JS Viewer control.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
silentPrint: true
});
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
silentPrint: true
});
Optional
themeViewer's UI theme.
// ESM usage
import {createViewer, UIThemes} from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
theme: UIThemes.defaultDark
});
var viewer = GrapeCity.ActiveReports.JSViewer.create({
theme: GrapeCity.ActiveReports.JSViewer.Themes.darkOled
});
The following options can be set during initialization or at run time while working with the JS Viewer.