// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.backToParent()
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.backToParent()
Gets the currently displayed page number.
An integer representing currently displayed page number.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.currentPage())
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.currentPage())
Removes the viewer content from the element.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root'
});
viewer.destroy()
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.destroy()
Exports the currently displayed report.
Specifies export format.
Function that is invoked once the export result is available (its Url is passed in the callback).
Indicates whether the save as dialog should be shown immediately once the export result is ready.
The export settings are available for RenderingExtensions.
Optional
isCancelRequested: (() => boolean | Promise<boolean>)The function is periodically called with a check to cancel the export task.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx',
availableExports: ['Pdf']
});
viewer.export('Pdf', downloadReport, true, { Title: '1997 Annual Report' })
// function fetches the report from uri(callback function)
var downloadReport = function (uri) {
var newWin = null;
// open uri in new window
try {
newWin = window.open(uri);
} catch (e) { }
// if browser rejects opening new window, open uri in current window
if (!newWin) {
window.location = uri;
}
};
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx',
availableExports: ['Pdf']
});
viewer.export('Pdf', downloadReport, true, { Title: '1997 Annual Report' })
// function fetches the report from uri(callback function)
var downloadReport = function (uri) {
var newWin = null;
// open uri in new window
try {
newWin = window.open(uri);
} catch (e) { }
// if browser rejects opening new window, open uri in current window
if (!newWin) {
window.location = uri;
}
};
Obtains the report TOC.
TOC tree.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.getToc())
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.getToc())
Makes the viewer to display the specific page. Page numeration starts with 1.
The number of pages to go to.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.goToPage(1)
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.goToPage(1)
Open report.
The id of the report.
Optional
reportParameters: Parameter[]The array of the parameters values.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root'
});
viewer.openReport('Invoice.rdlx')
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.openReport('Invoice.rdlx')
Gets the page count of the currently displayed report.
An integer representing page count.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.pageCount())
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
console.log(viewer.pageCount())
Prints the currently displayed report if any.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.print()
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.print()
Refreshes the report preview.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root'
});
viewer.refresh()
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.refresh()
Performs the search of a specific term with specific search options (match case, whole word) and invokes the specific callback with the search result passed.
String to find.
The object optionally defines the search options.
The function to call after performing search.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.search('a', { matchCase: true, wholePhrase: false }, (results) => console.log(results))
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root',
reportID: 'AnnualReport.rdlx'
});
viewer.search('a', { matchCase: true, wholePhrase: false }, (results) => console.log(results))
The viewer's sidebar instance. The developer may use it to toggle the sidebar visibility.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root'
});
viewer.sidebar.toggle(false); // hide sidebar
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.sidebar.toggle(false); // hide sidebar
Optional
themeGets or sets the viewer UI theme.
import {createViewer, UIThemes} from './jsViewer.min.js';
const viewer = createViewer({
element: '#root',
});
viewer.theme = UIThemes.defaultDark;
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.theme: GrapeCity.ActiveReports.JSViewer.Themes.defaultDark
The viewer's toolbar instance. The developer may use it to add the custom elements or remove the existing ones.
// ESM usage
import { createViewer } from './jsViewer.min.js';
const viewer = createViewer({
element: '#root'
});
viewer.toolbar.toggle(false); // hide toolbar
// UMD usage
var viewer = GrapeCity.ActiveReports.JSViewer.create({
element: '#root'
});
viewer.toolbar.toggle(false); // hide toolbar
Makes the viewer to display the parent report of the drill-down report.