[]
        
(Showing Draft Content)

ReportDesigner.ActionHandlers

Interface: ActionHandlers

ReportDesigner.ActionHandlers

Defines the contract for handling designer actions triggered by UI commands and hotkeys.

example

const handlers: ActionHandlers = {
	onSave: async (info) => ({ displayName: info.displayName }),
	onOpen: async () => ({ id: 'report-1', displayName: 'Sales Report' }),
};

Table of contents

Methods

Methods

onCreate

Optional onCreate(): Promise<undefined | Report | NewReport>

Creates a new report or selects a report to open.

example

const handlers = {} as ActionHandlers;
const report = await handlers.onCreate?.();

Returns

Promise<undefined | Report | NewReport>

A promise that resolves to the report, a new report definition, or undefined if the operation was canceled.


onOpen

Optional onOpen(): Promise<undefined | Report>

Opens an existing report.

example

const handlers = {} as ActionHandlers;
const report = await handlers.onOpen?.();

Returns

Promise<undefined | Report>

A promise that resolves to the report, or undefined if the operation was canceled.


onOpenFileMenu

Optional onOpenFileMenu(): void

Opens a custom file menu.

example

const handlers = {} as ActionHandlers;
handlers.onOpenFileMenu?.();

Returns

void


onRender

Optional onRender(report, resourceLocator?, uiTheme?): Promise<void>

Renders the current report.

example

const handlers = {} as ActionHandlers;
const reportDefinition = {} as ReportDefinition;
const resourceLocator = {} as Partial<ResourceLocator>;
await handlers.onRender?.(reportDefinition, resourceLocator, 'Default');

Parameters

Name Type Description
report ReportDefinition The report definition to render.
resourceLocator? Partial<ResourceLocator> The resource locator to resolve external resources.
uiTheme? UITheme The current UI theme.

Returns

Promise<void>


onSave

Optional onSave(options): Promise<undefined | SaveResult>

Saves the current report.

example

const handlers = {} as ActionHandlers;
const saveInfo = {} as SaveReportInfo;
const result = await handlers.onSave?.(saveInfo);

Parameters

Name Type Description
options SaveReportInfo The report information to save.

Returns

Promise<undefined | SaveResult>

A promise that resolves to the save result, or undefined if the operation was canceled.


onSaveAs

Optional onSaveAs(options): Promise<undefined | SaveAsResult>

Saves the current report as a new report.

example

const handlers = {} as ActionHandlers;
const saveNewInfo = {} as SaveNewReportInfo;
const result = await handlers.onSaveAs?.(saveNewInfo);

Parameters

Name Type Description
options SaveNewReportInfo The report information to save as new.

Returns

Promise<undefined | SaveAsResult>

A promise that resolves to the save-as result, or undefined if the operation was canceled.