[]
        
(Showing Draft Content)

Core.PageReport

Class: PageReport

Core.PageReport

Represents the page report API.

remarks Use this class to load a report definition or URI and render a PageDocument.

example

const report = new PageReport();

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new PageReport(options?)

Initializes a new instance of the PageReport class.

example

const report = new PageReport({ language: 'en' });

Parameters

Name Type Description
options? Partial<{ animations: Partial<{ charts: Partial<{ highlight: { enabled: boolean } ; onHover: { enabled: boolean } ; onLoad: { enabled: boolean } }> ; table: { onHover: { backgroundColor: string ; enabled: boolean ; textColor?: string } | { enabled: boolean ; textColor: string } } }> ; i18n: i18n ; language: string ; memoizeData: boolean }> The PageReport options.

Accessors

name

get name(): string

Gets the report name.

Returns

string


reportParameters

get reportParameters(): ReportParameters

Gets the report parameters API.

Returns

ReportParameters


resourceLocator

get resourceLocator(): ResourceLocator

Gets the report resource locator instance.

Returns

ResourceLocator


viewSettings

get viewSettings(): ViewSettings

Returns

ViewSettings

Methods

load

load(report, options?): Promise<void>

Loads a report template from a URI or a report definition.

example

await report.load('report.rdlx-json');

Parameters

Name Type Description
report string | Report The report URI or report definition object.
options? Object The execution-time settings.
options.environment? Environment -
options.reportParameters? { Name: string ; Value: ParameterVariant[] }[] -
options.resourceLocator? Partial<ResourceLocator> -

Returns

Promise<void>

A promise that resolves when the report is loaded.


run

run(logsSubscriber?): Promise<PageDocument>

Starts rendering the report and creates a PageDocument.

Optionally accepts a logs subscriber that will receive rendering logs during the document creation process.

example

const document = await report.run();
// with logs
const document = await report.run((logs, severity) => { console.log(logs, severity); });

Parameters

Name Type Description
logsSubscriber? LoggerSubscriber Optional callback for collecting render logs.

Returns

Promise<PageDocument>

A promise that resolves to the rendered document.