[]
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' }),
};
▸ 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?.();
Promise<undefined | Report | NewReport>
A promise that resolves to the report, a new report definition, or undefined if the operation was canceled.
▸ Optional onOpen(): Promise<undefined | Report>
Opens an existing report.
example
const handlers = {} as ActionHandlers;
const report = await handlers.onOpen?.();
Promise<undefined | Report>
A promise that resolves to the report, or undefined if the operation was canceled.
▸ Optional onOpenFileMenu(): void
Opens a custom file menu.
example
const handlers = {} as ActionHandlers;
handlers.onOpenFileMenu?.();
void
▸ 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');
| 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. |
Promise<void>
▸ 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);
| Name | Type | Description |
|---|---|---|
options |
SaveReportInfo |
The report information to save. |
Promise<undefined | SaveResult>
A promise that resolves to the save result, or undefined if the operation was canceled.
▸ 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);
| Name | Type | Description |
|---|---|---|
options |
SaveNewReportInfo |
The report information to save as new. |
Promise<undefined | SaveAsResult>
A promise that resolves to the save-as result, or undefined if the operation was canceled.