[]
ReportDesigner.Designer
Represents the report designer component.
remarks
Use this class to initialize the designer and interact with reports and UI APIs.
example
const designer = new Designer('#designer-host');
• new Designer(element, config?)
Initializes a new instance of the Designer class within the specified container.
example
const designer = new Designer('#designer-host', { language: 'en' });
| Name | Type | Description |
|---|---|---|
element |
string | object | Element |
The host element for the designer. This can be a CSS selector string, a DOM element, or a jQuery object. |
config? |
DesignerConfig |
The designer configuration settings. |
• get documentChanged(): Event<DocumentChangedEventArgs>
Gets the event raised when the document changes.
Event<DocumentChangedEventArgs>
▸ createReport(reportInfo, whenDirty?): Promise<void>
Creates a new report in the designer.
example
await designer.createReport({ reportType: 'CPL' });
| Name | Type | Description |
|---|---|---|
reportInfo |
NewReportInfo |
The report information used to create the report. |
whenDirty? |
WhenDirty |
The behavior when there are unsaved changes. |
Promise<void>
A promise that resolves when the report is created.
▸ destroy(): Promise<void>
Destroys the designer instance and releases resources.
example
await designer.destroy();
Promise<void>
▸ focus(): void
Moves focus to the designer.
example
designer.focus();
void
▸ getEditorAPI(): Promise<EditorAPI>
Gets the editor API for manipulating the report.
example
const editorApi = await designer.getEditorAPI();
editorApi.copy();
Promise<EditorAPI>
A promise that resolves to the editor API.
▸ getNotificationsAPI(): Promise<NotificationsAPI>
Gets the notifications API.
example
const notifications = await designer.getNotificationsAPI();
notifications.info('Report saved');
Promise<NotificationsAPI>
A promise that resolves to the notifications API.
▸ getPanelsAPI(): Promise<PanelsAPI>
Gets the panels API for the menu and sidebar.
example
const panels = await designer.getPanelsAPI();
panels.menu.open('file');
Promise<PanelsAPI>
A promise that resolves to the panels API.
▸ getReport(): Promise<ReportInfo>
Gets the current report information.
example
const info = await designer.getReport();
Promise<ReportInfo>
A promise that resolves to the report information.
▸ getReportPartsLibraries(): Promise<ReportPartsLibrary[]>
Gets the list of available Report Parts libraries.
example
const libraries = await designer.getReportPartsLibraries();
Promise<ReportPartsLibrary[]>
A promise that resolves to the list of libraries.
▸ processCommand(cmd): Promise<void>
Processes a designer command.
example
await designer.processCommand('save');
| Name | Type | Description |
|---|---|---|
cmd |
DesignerCommand |
The command to process. |
Promise<void>
A promise that resolves when the command is processed.
▸ resetUserPreferences(config?): Promise<void>
Resets stored user preferences to designer defaults.
example
await designer.resetUserPreferences({ units: 'cm' });
| Name | Type | Description |
|---|---|---|
config? |
Partial<DesignerConfig> |
Optional configuration values to apply while resetting preferences. |
Promise<void>
▸ setActionHandlers(actionHandlers): Promise<void>
Sets the action handlers for designer commands.
example
await designer.setActionHandlers({
onSave: async (info) => ({ displayName: info.displayName }),
});
| Name | Type | Description |
|---|---|---|
actionHandlers |
ActionHandlers |
The action handlers to apply. |
Promise<void>
A promise that resolves when the handlers are set.
▸ setDataSourceTemplates(templates): Promise<void>
Sets the data source templates used by the data panel.
example
await designer.setDataSourceTemplates([]);
| Name | Type | Description |
|---|---|---|
templates |
DataSourceTemplate[] |
The data source templates. |
Promise<void>
A promise that resolves when the templates are set.
▸ setMasterReport(masterReportId): Promise<void>
Sets the master report by identifier.
example
await designer.setMasterReport('master-1');
| Name | Type | Description |
|---|---|---|
masterReportId |
string |
The master report identifier. |
Promise<void>
A promise that resolves when the master report is set.
▸ setReport(report, whenDirty?, isDirtyInitial?): Promise<void>
Sets the current report in the designer.
example
await designer.setReport({ id: 'report-1', displayName: 'Sales Report' });
| Name | Type | Description |
|---|---|---|
report |
Report |
The report to load. |
whenDirty? |
WhenDirty |
The behavior when there are unsaved changes. |
isDirtyInitial? |
boolean |
The initial value for the dirty state after load. |
Promise<void>
A promise that resolves when the report is loaded.
▸ setReportPartsLibraries(libraries): Promise<void>
Sets the list of available Report Parts libraries.
example
await designer.setReportPartsLibraries([]);
| Name | Type | Description |
|---|---|---|
libraries |
ReportPartsLibrary[] |
The libraries to set. |
Promise<void>
A promise that resolves when the libraries are set.
▸ setResourceProvider(resourceProvider): Promise<void>
Sets the resource provider used to resolve external resources.
example
await designer.setResourceProvider({
getReportsList: async () => [],
});
| Name | Type | Description |
|---|---|---|
resourceProvider |
Partial<ResourceProvider> |
The resource provider implementation. |
Promise<void>
A promise that resolves when the provider is set.