@mescius/activereportsnet-designer 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1483 @@
1
+ /* eslint-disable max-len */
2
+ /**
3
+ * Type of **GrapeCity.ActiveReports.WebDesignerV2** object exported by **web-designer.js** module.
4
+ */
5
+
6
+ export type GlobalDesignerApiV2 = {
7
+ /**
8
+ * Renders **Web Designer** to **<div>** element with id **designerElementId** using the specified **DesignerOptions** object.
9
+ *
10
+ * **Example:**
11
+ * ```javascript
12
+ * GrapeCity.ActiveReports.WebDesigner.create('designer-id', designerOptions);
13
+ * ```
14
+ *
15
+ * @param designerElementId string
16
+ * @param designerOptions DesignerOptions object
17
+ * @returns DesignerApi of this instance
18
+ */
19
+ create: (designerElementId: string, designerOptions: DesignerOptions) => Promise<DesignerApiV2>;
20
+
21
+ /**
22
+ * Returns DesignerApi of previously created instance of **WebDesigner**
23
+ */
24
+ apiOf: (designerElementId: string) => DesignerApiV2 | undefined;
25
+ };
26
+
27
+
28
+ /**
29
+ * Type of object returned by functions from **GlobalDesignerApiV2**
30
+ */
31
+ export type DesignerApiV2 = {
32
+
33
+ /**
34
+ * Returns focus to Designer. Focus may be lost when plug-in components are opened/closed.\
35
+ * Returning focus is essential to continue using Designer hotkeys like Ctrl+Z (undo), Ctrl+Y (redo), etc.
36
+ *
37
+ * **Example:**
38
+ * ```javascript
39
+ * GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id').focus();
40
+ * ```
41
+ */
42
+ focus: () => void;
43
+
44
+ /**
45
+ * Returns **AboutInfo** object containing information about application name/version and product title/version.
46
+ *
47
+ * **Example:**
48
+ * ```javascript
49
+ * var aboutInfo = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id').getAboutInfo();
50
+ * ```
51
+ */
52
+ getAboutInfo: () => AboutInfo;
53
+
54
+
55
+ /**
56
+ * Returns **HelpInfo[]** containing title/link pairs of Designer-related Help pages.
57
+ *
58
+ * **Example:**
59
+ * ```javascript
60
+ * var helpInfos = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id').getHelpInfos();
61
+ * ```
62
+ */
63
+ getHelpInfos: () => HelpInfo[];
64
+
65
+ /**
66
+ * This object includes functions allowing to create/open/save report, etc.
67
+ */
68
+ document: DocumentApi;
69
+ };
70
+
71
+ /**
72
+ * This is V2 api, for legacy see ReportingApi
73
+ */
74
+ export type DocumentApi = {
75
+ /**
76
+ * Indicates whether report has unsaved changes.
77
+ *
78
+ * **Example:**
79
+ * ```javascript
80
+ * var hasUnsavedChanges = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id').hasUnsavedChanges();
81
+ * if (hasUnsavedChanges) console.log('Currently edited report has unsaved changes.');
82
+ * ```
83
+ */
84
+ hasUnsavedChanges: () => boolean;
85
+
86
+ /**
87
+ * Indicates whether report was saved before at least once
88
+ */
89
+ isNew: () => boolean;
90
+
91
+ /**
92
+ * Returns information about the currently edited report.
93
+ *
94
+ * **Example:**
95
+ * ```javascript
96
+ * var reportInfo = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id').info();
97
+ * console.log(`Report "${reportInfo.name}" is currently edited.`);
98
+ * ```
99
+ */
100
+ info: () => CurrentReportInfo;
101
+
102
+ /**
103
+ * Creates a new report to be edited in Designer using the specified **CreateReportOptions** object.
104
+ *
105
+ * **Example:**
106
+ * ```javascript
107
+ * var api = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id');
108
+ * api.document.create().then(() => {
109
+ * console.log('An empty RDL report is created.');
110
+ * })
111
+ * ```
112
+ *
113
+ * @param options CreateReportOptions object
114
+ */
115
+ create: (options?: CreateReportOptions) => Promise<CreateReportInfo>;
116
+
117
+ /**
118
+ * Shows open report dialog
119
+ */
120
+ open: () => void;
121
+
122
+ /**
123
+ * Opens an existing report to be edited in Designer with specified id.
124
+ * Optionally you can pass name and content, else it will be loaded from server.
125
+ *
126
+ * **Example:**
127
+ * ```javascript
128
+ * var api = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id');
129
+ * api.document.openById('MyReport.rdlx').then(() => {
130
+ * console.log('An existing report "MyReport.rdlx" is opened.');
131
+ * });
132
+ * var reportContent = { Type: 'report', Body: { ReportItems: [ {Type: 'textbox', Name: 'TextBox1', Width: '5in', Height: '1in' } ] }};
133
+ * api.document.openById('NewReport.rdlx', 'NewReport', reportContent).then(() => {
134
+ * console.log('New report with one textbox created and opened.');
135
+ * });
136
+ * ```
137
+ *
138
+ * @param options OpenReportOptions object
139
+ */
140
+ openById: (id: string, name?: string, content?: any) => Promise<OpenReportInfo>;
141
+
142
+ /**
143
+ * Saves the report currently edited in Designer, if report is new, then "Save As" dialog will be opened.
144
+ */
145
+ save: () => void;
146
+
147
+ /**
148
+ * Opens "Save As" dialog
149
+ */
150
+ saveAs: () => void;
151
+
152
+ /**
153
+ * Saves the report currently edited in Designer using the specified **id**.
154
+ *
155
+ * **Example:**
156
+ * ```javascript
157
+ * var api = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id');
158
+ * api.document.saveById('MyReport.rdlx')
159
+ * ```
160
+ * @param options SaveReportOptions object
161
+ */
162
+ saveById: (id?: string, name?: string) => Promise<SaveReportInfo>;
163
+
164
+ /**
165
+ * Saves the report currently edited in Designer using the specified **name**.
166
+ *
167
+ * **Example:**
168
+ * ```javascript
169
+ * var api = GrapeCity.ActiveReports.WebDesignerV2.apiOf('designer-id');
170
+ * api.document.saveById('MyReport.rdlx')
171
+ * ```
172
+ * @param options SaveReportOptions object
173
+ */
174
+ saveByName: (name: string) => Promise<SaveReportInfo>;
175
+
176
+ };
177
+
178
+ export type DesignerOptions = {
179
+ /**
180
+ * Specifies language to use for the Designer.
181
+ * If **language** is not specified, browser preferences are used.
182
+ * **Example:**
183
+ * ```javascript
184
+ * designerOptions.language = 'ja';
185
+ * ```
186
+ */
187
+ language?: string;
188
+
189
+ /**
190
+ * @deprecated Use **language** instead
191
+ *
192
+ * Specifies locale used for displaying Designer.
193
+ * If **locale** is not specified explicitly here, the locale corresponding to the browser preferences is used.
194
+ * **Example:**
195
+ * ```javascript
196
+ * designerOptions.locale = 'ja';
197
+ * ```
198
+ */
199
+ locale?: 'en' | 'ja' | 'zh';
200
+
201
+ /**
202
+ * @deprecated Use resource bundles instead
203
+ *
204
+ * Specifies custom localization data.
205
+ *
206
+ * **Example:**
207
+ * ```javascript
208
+ * designerOptions.localeData = customLocaleData;
209
+ * ```
210
+ */
211
+ localeData?: {
212
+ /** namespace */
213
+ ns: string;
214
+
215
+ /** locale */
216
+ lng: string;
217
+
218
+ /** localization resources */
219
+ resources: any;
220
+ }[];
221
+
222
+ /**
223
+ * Specifies the default measurement units used in Designer.
224
+ * By default units = 'in'
225
+ *
226
+ * **Example:**
227
+ * ```javascript
228
+ * designerOptions.units = 'cm';
229
+ * ```
230
+ */
231
+ units?: 'in' | 'cm';
232
+
233
+ /**
234
+ * Specifies the list of fonts displayed in font properties drop-downs all over Designer.
235
+ * If **fonts** are not specified explicitly here, the default list of fonts is used:
236
+ * 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Geneva', 'Georgia', 'Helvetica',
237
+ * 'Impact', 'Lucida Console', 'Meiryo', 'Meiryo UI', 'MingLiU', 'MingLiU-ExtB', 'MS Gothic', 'MS Mincho',
238
+ * 'MS PGothic', 'MS PMincho', 'MS Song', 'MS UI Gothic', 'NSimSun', 'Osaka', 'PMingLiU', 'PMingLiU-ExtB',
239
+ * 'SimSun', 'SimSun-ExtB', 'Song', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Yu Gothic'.
240
+ *
241
+ * **Example:**
242
+ * ```javascript
243
+ * designerOptions.fonts = ['Arial', 'Courier New', 'Times New Roman'];
244
+ * ```
245
+ */
246
+ fonts?: string[];
247
+
248
+ /**
249
+ * It is possible to limit and/or reorder available report items.
250
+ * Specify comma-separated report items keys from this list:
251
+ *
252
+ * ```none
253
+ * BandedList, Barcode, Bullet, Chart, CheckBox, Container, FormattedText, Image, InputField, Line, List,
254
+ * OverflowPlaceholder, Shape, Sparkline, Subreport, Table, TableOfContents, Tablix, TextBox
255
+ * ```
256
+ *
257
+ * **Example:**
258
+ * ```javascript
259
+ * designerOptions.reportItems = 'TextBox,CheckBox,Table,Chart,Image';
260
+ * ```
261
+ */
262
+ reportItems?: string;
263
+
264
+ /**
265
+ * Customizable report items features are specified here.
266
+ */
267
+ reportItemsFeatures: {
268
+ /** Barcode features */
269
+ barcode: {
270
+ /**
271
+ * Limits the list of barcode symbologies available for creation.\
272
+ * By default all barcode symbologies supported by ActiveReports are available.
273
+ *
274
+ * **Example:**
275
+ * ```javascript
276
+ * designerOptions.reportItemsFeatures.barcode.symbologies = ['Code_128_A', 'Code_128_B', 'Code_128_C'];
277
+ * ```
278
+ */
279
+ symbologies?: BarcodeSymbology[];
280
+ };
281
+
282
+ /** Table features */
283
+ table: {
284
+ /**
285
+ * Specifies whether **Table Header** needs to be auto-filled when a field is dropped to **Table Details**.\
286
+ * For example, if **ProductName** field is dropped to **Details**, **Product Name** value is set to **Header**.\
287
+ * By default this feature is **enabled**.
288
+ *
289
+ * **Example:**
290
+ * ```javascript
291
+ * designerOptions.reportItemsFeatures.table.autoFillHeader = false;
292
+ * ```
293
+ */
294
+ autoFillHeader: boolean;
295
+
296
+ /**
297
+ * Specifies whether **Table Footer** needs to be auto-filled when a field is dropped to **Table Details**.\
298
+ * For example, if **ProductName** field is dropped to **Details**, **=Count([ProductName])** value is set to **Footer**.\
299
+ * By default this feature is **disabled**.
300
+ *
301
+ * **Example:**
302
+ * ```javascript
303
+ * designerOptions.reportItemsFeatures.table.autoFillFooter = true;
304
+ * ```
305
+ */
306
+ autoFillFooter: boolean;
307
+
308
+ /**
309
+ * Specifies whether vertical merge of cells is enabled within **Table Header**, **Details** and **Footer**.\
310
+ * By default this feature is **enabled**.
311
+ *
312
+ * **Example:**
313
+ * ```javascript
314
+ * designerOptions.reportItemsFeatures.table.canMergeCellsVertically = false;
315
+ * ```
316
+ */
317
+ canMergeCellsVertically: boolean;
318
+ };
319
+
320
+ /** Tablix features */
321
+ tablix: {
322
+ /**
323
+ * Specifies whether Tablix Wizard should hide cross-aggregates functionality.\
324
+ * By default this feature is **enabled**.
325
+ *
326
+ * **Example:**
327
+ * ```javascript
328
+ * designerOptions.reportItemsFeatures.tablix.crossAggregates = false;
329
+ * ```
330
+ */
331
+ crossAggregates: boolean,
332
+
333
+ /**
334
+ * Specifies whether **Tablix Corner Cell** needs to be auto-filled when a field is dropped to **Tablix Row Group Cell**.\
335
+ * For example, if **ProductName** field is dropped to **Row Group Cell**, **Product Name** value is set to **Corner Cell**.\
336
+ * By default this feature is **enabled**.
337
+ *
338
+ * **Example:**
339
+ * ```javascript
340
+ * designerOptions.reportItemsFeatures.tablix.autoFillCorner = false;
341
+ * ```
342
+ */
343
+ autoFillCorner: boolean;
344
+
345
+ /**
346
+ * Specifies whether Tablix Wizard is available for creating/editing Tablix.\
347
+ * By default this feature is **enabled**.
348
+ *
349
+ * **Example:**
350
+ * ```javascript
351
+ * designerOptions.reportItemsFeatures.tablix.canUseWizard = false;
352
+ * ```
353
+ */
354
+ canUseWizard: boolean;
355
+ };
356
+ };
357
+
358
+ /**
359
+ * When **lockLayout** is enabled, it is only possible to modify properties of existing report items.\
360
+ * I.e., adding a new report item or deleting of an existing one is not possible as well as other operations that modify report layout structure.\
361
+ * By default this feature is **disabled**.
362
+ *
363
+ * **Example:**
364
+ * ```javascript
365
+ * designerOptions.lockLayout = true;
366
+ * ```
367
+ */
368
+ lockLayout: boolean;
369
+
370
+ /**
371
+ * When **restoreUnsavedReport** is **enabled**, the last unsaved report can be restored if browser tab or browser itself gets accidentally closed.\
372
+ * In case **restoreUnsavedReport** is **disabled**, the aforementioned functionality is not available.\
373
+ * By default this feature is **enabled**.
374
+ *
375
+ * **Example:**
376
+ * ```javascript
377
+ * designerOptions.restoreUnsavedReport = false;
378
+ * ```
379
+ */
380
+ restoreUnsavedReport: boolean;
381
+
382
+ /**
383
+ * If **reportInfo.id** is specified, the corresponding report will be opened in Designer when Designer application is rendered.
384
+ *
385
+ * **Example:**
386
+ * ```javascript
387
+ * designerOptions.reportInfo.id = 'MyReport.rdlx';
388
+ * ```
389
+ */
390
+ reportInfo: {
391
+ /** report id */
392
+ id?: string | null;
393
+ };
394
+
395
+ /**
396
+ * Specifies the expression syntax used in Designer:
397
+ * 'i11n' - interpolation syntax, 'rdl' - "old" rdl expression syntax
398
+ * By default the interpolation syntax is used for expressions.
399
+ *
400
+ * **Example:**
401
+ * ```javascript
402
+ * designerOptions.expressionSyntax = 'rdl';
403
+ * ```
404
+ */
405
+ expressionSyntax: 'i11n' | 'rdl';
406
+
407
+ /**
408
+ * You can plug-in **Report Viewer** component by providing **openViewer** function to **DesignerOptions** object.\
409
+ * When **openViewer** is passed to **DesignerOptions**, **Preview** button appears in Designer application bar.
410
+ *
411
+ * **Example:**
412
+ * ```javascript
413
+ * designerOptions.openViewer = function(options) {
414
+ * // ... create viewer and open report
415
+ * };
416
+ * ```
417
+ *
418
+ * @param options ViewerOptions object
419
+ */
420
+ openViewer?: (options: ViewerOptions) => void;
421
+
422
+ /** **File View** settings */
423
+ fileView: {
424
+ /**
425
+ * Specifies whether **File View** tab needs to be shown.\
426
+ * **File View** tab is **visible** by default.
427
+ *
428
+ * **Example:**
429
+ * ```javascript
430
+ * designerOptions.fileView.visible = false;
431
+ * ```
432
+ */
433
+ visible: boolean;
434
+ };
435
+
436
+ /** **Save** button settings */
437
+ saveButton: {
438
+ /**
439
+ * Specifies whether **Save** button needs to be shown.\
440
+ * **Save** button is **not visible** by default.
441
+ *
442
+ * **Example:**
443
+ * ```javascript
444
+ * designerOptions.saveButton.visible = true;
445
+ * ```
446
+ */
447
+ visible: boolean;
448
+ };
449
+
450
+ /** **Save As** button settings */
451
+ saveAsButton: {
452
+ /**
453
+ * Specifies whether **Save As** button needs to be shown.\
454
+ * **Save As** button is **not visible** by default.
455
+ *
456
+ * **Example:**
457
+ * ```javascript
458
+ * designerOptions.saveAsButton.visible = true;
459
+ * ```
460
+ */
461
+ visible: boolean;
462
+ };
463
+
464
+ /** **Open** button settings */
465
+ openButton: {
466
+ /**
467
+ * Specifies whether **Open** button needs to be shown.\
468
+ * **Open** button is **not visible** by default.
469
+ *
470
+ * **Example:**
471
+ * ```javascript
472
+ * designerOptions.openButton.visible = true;
473
+ * ```
474
+ */
475
+ visible: boolean;
476
+ };
477
+
478
+ /** **Insert** tab settings */
479
+ insertTab: {
480
+ /**
481
+ * Specifies whether **Insert** tab needs to be shown in Designer application bar.\
482
+ * **Tool Box** and **Insert** tab are interchangeable.\
483
+ * **Insert** tab is **not visible** by default.
484
+ *
485
+ * **Example:**
486
+ * ```javascript
487
+ * designerOptions.insertTab.visible = true;
488
+ * ```
489
+ */
490
+ visible: boolean;
491
+ };
492
+
493
+ /** **Report Explorer** settings */
494
+ reportExplorer: {
495
+ /**
496
+ * Specifies whether **Report Explorer** button needs to be shown.\
497
+ * **Report Explorer** button is **visible** by default.
498
+ *
499
+ * **Example:**
500
+ * ```javascript
501
+ * designerOptions.reportExplorer.visible = false;
502
+ * ```
503
+ */
504
+ visible: boolean;
505
+ };
506
+
507
+ /** **Group Editor** settings */
508
+ groupEditor: {
509
+ /**
510
+ * Specifies whether **Group Editor** button needs to be shown.\
511
+ * **Group Editor** button is **visible** by default.
512
+ *
513
+ * **Example:**
514
+ * ```javascript
515
+ * designerOptions.groupEditor.visible = false;
516
+ * ```
517
+ */
518
+ visible: boolean;
519
+ };
520
+
521
+ /** **Tool Box** settings */
522
+ toolBox: {
523
+ /**
524
+ * Specifies whether left-side menu **Tool Box** needs to be shown.\
525
+ * **Tool Box** is **visible** by default.
526
+ *
527
+ * **Example:**
528
+ * ```javascript
529
+ * designerOptions.toolBox.visible = false;
530
+ * ```
531
+ */
532
+ visible: boolean;
533
+ };
534
+
535
+ /** **Properties** tab settings */
536
+ propertiesTab: {
537
+ /**
538
+ * Specifies whether **Properties** tab needs to be shown.\
539
+ * **Properties** tab is **visible** by default.
540
+ *
541
+ * **Example:**
542
+ * ```javascript
543
+ * designerOptions.propertiesTab.visible = false;
544
+ * ```
545
+ */
546
+ visible: boolean;
547
+
548
+ /**
549
+ * Specifies available properties modes.\
550
+ * The default value is **Both**.
551
+ *
552
+ * **Example:**
553
+ * ```javascript
554
+ * designerOptions.propertiesTab.mode = 'Basic';
555
+ * ```
556
+ */
557
+ mode: 'Basic' | 'Advanced' | 'Both';
558
+
559
+ /**
560
+ * Relevant only when mode is **Both**.\
561
+ * If **undefined**, the last used properties mode is set.
562
+ *
563
+ * **Example:**
564
+ * ```javascript
565
+ * designerOptions.propertiesTab.defaultMode = 'Advanced';
566
+ * ```
567
+ */
568
+ defaultMode?: 'Basic' | 'Advanced';
569
+ };
570
+
571
+ /** **Data** tab settings */
572
+ dataTab: {
573
+ /**
574
+ * Specifies whether **Data** tab needs to be shown.\
575
+ * **Data** tab is **visible** by default.
576
+ *
577
+ * **Example:**
578
+ * ```javascript
579
+ * designerOptions.dataTab.visible = false;
580
+ * ```
581
+ */
582
+ visible: boolean;
583
+
584
+ /** **Data Sources** section settings */
585
+ dataSources: {
586
+ /**
587
+ * Specifies whether **Data Sources** section needs to be shown.\
588
+ * **Data Sources** section is **visible** by default.
589
+ *
590
+ * **Example:**
591
+ * ```javascript
592
+ * designerOptions.dataTab.dataSources.visible = false;
593
+ * ```
594
+ */
595
+ visible: boolean;
596
+
597
+ /**
598
+ * Specifies whether it is possible to modify (including add/edit/remove) data sources.\
599
+ * By default this feature is **disabled**.
600
+ *
601
+ * **Example:**
602
+ * ```javascript
603
+ * designerOptions.dataTab.dataSources.canModify = true;
604
+ * ```
605
+ */
606
+ canModify: boolean;
607
+
608
+ /** Options for data sources and data source editor */
609
+ options: {
610
+ /** Specifies the list of predefined data providers available in data source editor.\
611
+ * By default all the predefined providers are present.
612
+ *
613
+ * **Example:**
614
+ * ```javascript
615
+ * designerOptions.dataTab.dataSources.options.predefinedProviders = ['SQL', 'JSON'];
616
+ * ```
617
+ */
618
+ predefinedProviders?: ('SQL' | 'OLEDB' | 'ODBC' | 'JSON' | 'CSV' | 'XML')[],
619
+
620
+ /** Specifies the list of OLE DB providers available in data source editor.\
621
+ * By default 'Microsoft.Jet.OLEDB.4.0', 'SQLOLEDB.1', 'MSDataShape.1', 'MSDASQL.1' are present.
622
+ *
623
+ * **Example:**
624
+ * ```javascript
625
+ * designerOptions.dataTab.dataSources.options.oleDbProviders = ['Microsoft.Jet.OLEDB.4.0', 'SQLOLEDB.1'];
626
+ * ```
627
+ */
628
+ oleDbProviders?: string[],
629
+
630
+ /** Specifies the list of custom data providers available in data source editor.\
631
+ * By default there are no custom data providers present.
632
+ *
633
+ * **Example:**
634
+ * ```javascript
635
+ * designerOptions.dataTab.dataSources.options.customProviders = [{ key: 'CDP', name: 'Custom Data Provider' }];
636
+ * ```
637
+ */
638
+ customProviders?: {
639
+ /**
640
+ * key - data provider identifier\
641
+ * This value is used for **DataSource.ConnectionProperties.DataProvider** property.
642
+ */
643
+ key: string;
644
+
645
+ /**
646
+ * name - data provider label\
647
+ * This value is used as a friendly data provider label in UI.
648
+ */
649
+ name: string;
650
+ }[],
651
+ },
652
+ };
653
+
654
+ /** **Data Sets** section settings */
655
+ dataSets: {
656
+ /**
657
+ * Specifies whether **Data Sets** section needs to be shown.\
658
+ * **Data Sets** section is **visible** by default.
659
+ *
660
+ * **Example:**
661
+ * ```javascript
662
+ * designerOptions.dataTab.dataSets.visible = false;
663
+ * ```
664
+ */
665
+ visible: boolean;
666
+
667
+ /**
668
+ * Specifies whether it is possible to modify (including add/edit/remove) data sets.\
669
+ * By default this feature is **disabled**.
670
+ *
671
+ * **Example:**
672
+ * ```javascript
673
+ * designerOptions.dataTab.dataSets.canModify = true;
674
+ * ```
675
+ */
676
+ canModify: boolean;
677
+ };
678
+
679
+ /** **Parameters** section settings */
680
+ parameters: {
681
+ /**
682
+ * Specifies whether **Parameters** section needs to be shown.\
683
+ * **Parameters** section is visible by default.
684
+ *
685
+ * **Example:**
686
+ * ```javascript
687
+ * designerOptions.dataTab.parameters.visible = false;
688
+ * ```
689
+ */
690
+ visible: boolean;
691
+
692
+ /**
693
+ * Specifies whether it is possible to modify (including add/edit/remove) report parameters.\
694
+ * By default this feature is **enabled**.
695
+ *
696
+ * **Example:**
697
+ * ```javascript
698
+ * designerOptions.dataTab.parameters.canModify = false;
699
+ * ```
700
+ */
701
+ canModify: boolean;
702
+ };
703
+
704
+ /** **Common Values** section settings */
705
+ commonValues: {
706
+ /**
707
+ * Specifies whether **Common Values** section needs to be shown.\
708
+ * **Common Values** section is **visible** by default.
709
+ *
710
+ * **Example:**
711
+ * ```javascript
712
+ * designerOptions.dataTab.commonValues.visible = false;
713
+ * ```
714
+ */
715
+ visible: boolean;
716
+ };
717
+ };
718
+
719
+ /** **Units Button** settings */
720
+ unitsButton: {
721
+ /**
722
+ * Specifies whether **Units Button** button needs to be shown.\
723
+ * **Units Button** button is **visible** by default.
724
+ *
725
+ * **Example:**
726
+ * ```javascript
727
+ * designerOptions.unitsButton = { visible: false };
728
+ * ```
729
+ */
730
+ visible: boolean;
731
+ };
732
+
733
+ /** **Grid Size** editor settings */
734
+ gridSize: {
735
+ /**
736
+ * Specifies whether **Grid Size** editor in **Status Bar** needs to be shown.\
737
+ * **Grid Size** editor is **visible** by default.
738
+ *
739
+ * **Example:**
740
+ * ```javascript
741
+ * designerOptions.gridSize.visible = false;
742
+ * ```
743
+ */
744
+ visible: boolean;
745
+
746
+ /**
747
+ * Specifies grid size value by designer first start. if units = 'cm', value = 0.5cm by default. Else, value = 0,25in by default
748
+ *
749
+ * **Example:**
750
+ * ```javascript
751
+ * designerOptions.gridSize.value = '0.5in';
752
+ * ```
753
+ */
754
+ value?: string;
755
+ };
756
+
757
+ /** **Show Grid** toggle settings */
758
+ showGrid: {
759
+ /**
760
+ * Specifies whether **Show Grid** toggle in Status Bar needs to be shown.\
761
+ * **Show Grid** toggle is **visible** by default.
762
+ *
763
+ * **Example:**
764
+ * ```javascript
765
+ * designerOptions.showGrid.visible = false;
766
+ * ```
767
+ */
768
+ visible: boolean;
769
+
770
+ /**
771
+ * If **Show Grid** toggle is **not visible**, it is possible to specify **Show Grid** value as *true* or *false*.
772
+ *
773
+ * **Example:**
774
+ * ```javascript
775
+ * designerOptions.showGrid.value = false;
776
+ * ```
777
+ */
778
+ value?: boolean;
779
+ };
780
+
781
+ /** Specifies snapToGrid option by designer first start. By default snapToGrid = false */
782
+ snapToGrid?: boolean;
783
+
784
+ /** Specifies snapToGuides option by designer first start. By default snapToGuides = false */
785
+ snapToGuides?: boolean
786
+
787
+ disableFocusTimer: boolean;
788
+
789
+ /** Specifies Rulers settings. */
790
+ rulers?: {
791
+ /** Specifies whether **Rulers** needs to be shown by designer first start. */
792
+ visible?: boolean;
793
+
794
+ /** Specifies snapStep value. By default snapStep = { in: 0.25, cm: 0.5 } */
795
+ snapStep?: {
796
+ in: number,
797
+ cm: number,
798
+ }
799
+ }
800
+
801
+ /** server-related settings */
802
+ server: {
803
+ /** Specifies the base URL for Designer Server API.\
804
+ * By default its value is 'api'.
805
+ *
806
+ * **Example:**
807
+ * ```javascript
808
+ * designerOptions.server.url = 'api/designer';
809
+ * ```
810
+ */
811
+ url: string;
812
+ };
813
+
814
+ /**
815
+ * You can implement custom logic for updating document's title when edited report gets updated in Designer.\
816
+ *
817
+ * By default `updateTitle` is `undefined` and report's name is used as a document title.
818
+ *
819
+ * **Example:**
820
+ * ```javascript
821
+ * designerOptions.updateTitle = ({ reportName, dirty }) => `${reportName}${dirty ? ' - Has Unsaved Changes!' : ''}`;
822
+ * ```
823
+ *
824
+ * @param options ReportTitleInfo object
825
+ */
826
+ updateTitle?: (info: ReportTitleInfo) => string;
827
+
828
+ /**
829
+ * You can implement custom logic for updating route when edited report `id` gets updated in Designer.\
830
+ * Report `id` is updated on creating/opening/saving a report - after that `updateRoute` is called.
831
+ *
832
+ * By default `updateRoute` is `undefined` so route remains unchanged.
833
+ *
834
+ * **Example:**
835
+ * ```javascript
836
+ * designerOptions.updateRoute = function(options) {
837
+ * // ... custom logic for updating route
838
+ * };
839
+ * ```
840
+ *
841
+ * @param options UpdateRouteOptions object
842
+ */
843
+ updateRoute?: (options: UpdateRouteOptions) => void;
844
+
845
+ /**
846
+ * Specifies report items on toolBox and their order \
847
+ *
848
+ * By default items for cpl report: [ 'textbox', 'checkbox', 'container', 'line', 'shape', 'tableofcontents',
849
+ * 'image', 'list', 'table', 'tablix', 'chart', 'bullet', 'barcode', 'formattedtext',
850
+ * 'richtext', 'sparkline', 'subreport', 'bandedlist', 'inputfield' ]
851
+ *
852
+ * By default items for fpl report: [ 'textbox', 'checkbox', 'container', 'line', 'shape', 'tableofcontents',
853
+ * 'image', 'list', 'table', 'tablix', 'chart', 'bullet', 'barcode', 'formattedtext',
854
+ * 'richtext', 'sparkline', 'subreport', 'overflowplaceholder', 'bandedlist', 'inputfield' ]
855
+ *
856
+ * **Example:**
857
+ * ```javascript
858
+ * designerOptions.toolBoxContent = {
859
+ * cpl: [ 'checkbox', 'container', 'textbox' ],
860
+ * fpl: [ 'image', 'list', 'table', 'tablix', 'chart', 'bullet', 'barcode', 'formattedtext' ],
861
+ * };
862
+ * ```
863
+ */
864
+ toolBoxContent?: {
865
+ cpl: ToolBoxContentItemType[];
866
+ fpl: ToolBoxContentItemType[];
867
+ };
868
+
869
+ /** Specifies additional styles to add to report item styles.
870
+ *
871
+ * **Example:**
872
+ * ```javascript
873
+ * designerOptions.reportStyles = [
874
+ * {
875
+ * Bullet: [{
876
+ * id: 'c8aa4403-83ef-402b-a7da-032063cf625a',
877
+ * name: 'additionalBulletStyle1',
878
+ * content: {
879
+ * ValueColor: 'red',
880
+ * LabelFontColor: '=Theme.Colors!Dark1',
881
+ * LabelFontFamily: '=Theme.Fonts!MinorFont.Family',
882
+ * LabelFontSize: '=Theme.Fonts!MinorFont.Size',
883
+ * LabelFontStyle: '=Theme.Fonts!MinorFont.Style',
884
+ * TicksLineColor: '=Theme.Colors(1,0)'
885
+ * }
886
+ * },
887
+ * ],
888
+ * List: [
889
+ * { id: '3d2c3781-4eea-4ac3-8d50-636edd9328d5',
890
+ * name: 'additionalListStyle1',
891
+ * content: {},
892
+ * },
893
+ * { id: '5b7b4e73-22e5-42ed-99c4-62840bdde79d',
894
+ * name: 'additionalListStyle2',
895
+ * content: {
896
+ * BackgroundColor: '=Theme.Colors!Accent1',
897
+ * Border: {
898
+ * Color: '=Theme.Colors(4,4)',
899
+ * Width: '1pt',
900
+ * Style: 'Solid',
901
+ * }
902
+ * }
903
+ * }]
904
+ * },
905
+ * { ChartPalette: [{
906
+ * id: 'c8aa4403-83ef-402b-a7da-0320444',
907
+ * name: 'additionalChartPalette',
908
+ * content: ['red', '=Theme.Colors!Accent2', '=Theme.Colors!Accent3', '=Theme.Colors!Accent4', '=Theme.Colors!Accent5', '=Theme.Colors!Accent6', '=Theme.Colors(5,4)', '=Theme.Colors(5,5)', '=Theme.Colors(5,6)', '=Theme.Colors(5,7)', '=Theme.Colors(5,8)', '=Theme.Colors(5,9)']
909
+ * }]
910
+ * },
911
+ * ];
912
+ * ```
913
+ */
914
+ reportStyles?: ReportStyles[];
915
+
916
+ /** Reports as a rdlx-json strings, report items from these reports will be used as a templates for creating new items
917
+ *
918
+ * imperialTemplates should include reports with units = 'in'
919
+ * metricTemplates should include reports with units = 'cm'
920
+ *
921
+ * Should use fpl-reports to set custom templates for specific fpl-reportItems, for example 'OverflowPlaceHolder'
922
+ * It is preferable to use cpl-reports to set custom templates for all other report items, as well as for pageHeader and pageFooter.
923
+ *
924
+ * For Report you can set ConsumeContainerWhitespace and Page-properties: BottomMargin, LeftMargin, RightMargin, TopMargin, PageHeight, PageWidth, ColumnSpacing
925
+ * For the rest of the report items, all properties are set, including, for example, the number of columns in the table or barcode default symbology
926
+ *
927
+ * Note: If in a subsequent report in the array there is the same reportItem as in the previous one, only last template for this reportItem will be set
928
+ *
929
+ * Also you can set multiple init templates for some report items. For this, you should add report with more then one report items the same type. Templates with the same names will be replaced.
930
+ * Use 'TemplateName' custom property of each report item to set a localized name of the template
931
+ * Use 'AllowWizard' custom property of a chart report item to allow use the chart wizard when this report item is created
932
+ * For example: ... ,"CustomProperties":[{"Name":"TemplateName","Value":"Doughnut Chart"}, {"Name":"AllowWizard","Value":"true"},...],...
933
+ *
934
+ * **Example:**
935
+ * ```javascript
936
+ * designerOptions.customInitTemplates = {
937
+ * imperialTemplates: ['{"Name":"Report","Width":"5in","Layers":[{"Name":"default"}],"CustomProperties":[{"Name":"DisplayType","Value":"Page"},{"Name":"SizeType","Value":"Default"},{"Name":"PaperOrientation","Value":"Portrait"}],"Page":{"PageWidth":"8.5in","PageHeight":"11in","RightMargin":"1in","LeftMargin":"1in","TopMargin":"1in","BottomMargin":"1in","Columns":1,"ColumnSpacing":"0in"},"Body":{"Height":"0.25in","ReportItems":[{"Type":"textbox","Name":"TextBox1","CustomProperties":[],"CanGrow":true,"KeepTogether":true,"Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Width":"5in","Height":"0.25in"}]}}'],
938
+ * metricTemplates: ['{"Name":"Report","Width":"10cm","Layers":[{"Name":"default"}],"CustomProperties":[{"Name":"DisplayType","Value":"Page"},{"Name":"SizeType","Value":"Default"},{"Name":"PaperOrientation","Value":"Portrait"}],"Page":{"PageWidth":"8.5in","PageHeight":"11in","RightMargin":"1in","LeftMargin":"1in","TopMargin":"1in","BottomMargin":"1in","Columns":1,"ColumnSpacing":"0in"},"Body":{"Height":"0.75cm","ReportItems":[{"Type":"textbox","Name":"TextBox1","CustomProperties":[],"CanGrow":true,"KeepTogether":true,"Style":{"PaddingLeft":"2pt","PaddingRight":"2pt","PaddingTop":"2pt","PaddingBottom":"2pt"},"Left":"0cm","Top":"0cm","Width":"10cm","Height":"0.75cm"}]}}'],
939
+ * };
940
+ * * ```
941
+ */
942
+ customInitTemplates?: {
943
+ imperialTemplates?: string[];
944
+ metricTemplates?: string[];
945
+ };
946
+
947
+ /** Filters for Expression Editor nodes
948
+ *
949
+ * **Example:**
950
+ * ```javascript
951
+ * designerOptions.expressionEditorNodesFilter = (key) => {
952
+ * if (key.includes('CommonValues')) return false;
953
+ * if (key.includes('aggregate.aggregateIfWithScope')) return false;
954
+ * return true;
955
+ * }
956
+ */
957
+ expressionEditorNodesFilter?: (key: string) => boolean;
958
+
959
+ documentApiHandlers: {
960
+ /**
961
+ * async handler, cancels saving process if returned false
962
+ */
963
+ onBeforeSave?: (info: SaveReportInfo) => Promise<boolean>,
964
+
965
+ /**
966
+ * handler that is called when save is complete
967
+ */
968
+ onAfterSave?: (info: SaveReportInfo) => void,
969
+
970
+ /**
971
+ * async handler, cancels opening process if returned false
972
+ */
973
+ onBeforeOpen?: () => Promise<boolean>,
974
+
975
+ /**
976
+ * handler that is called when open is complete
977
+ */
978
+ onAfterOpen?: () => void,
979
+
980
+ /**
981
+ * async handler, cancels create process if returned false
982
+ */
983
+ onBeforeCreate?: () => Promise<boolean>,
984
+
985
+ /**
986
+ * handler that is called when create is complete
987
+ */
988
+ onAfterCreate?: () => void,
989
+
990
+ },
991
+
992
+ /** @deprecated use documentApiHandlers.onAfterSave instead */
993
+ onReportSaved?: (reportInfo: SaveReportInfo) => void;
994
+
995
+ /**
996
+ * Disable usage of system clipboard. Copy-paste between designer instances will work only in the same browser in the same domain.
997
+ */
998
+ disableSystemClipboard?: boolean;
999
+ };
1000
+
1001
+ type ToolBoxContentItemType = 'textbox' | 'checkbox' | 'container' | 'line' | 'shape' | 'tableofcontents' |
1002
+ 'image' | 'list' | 'table' | 'tablix' | 'chart' | 'bullet' | 'barcode' | 'formattedtext' |
1003
+ 'richtext' | 'sparkline' | 'subreport' | 'overflowplaceholder' | 'bandedlist' | 'inputfield';
1004
+
1005
+ type Report = Record<string, any>;
1006
+ type ReportTemplate = Record<string, any>;
1007
+
1008
+ type ReportItemStyle<T> = {
1009
+ id: string;
1010
+ name: string;
1011
+ content: T;
1012
+ };
1013
+ type BorderStyle = {
1014
+ Color?: string;
1015
+ Style?: string;
1016
+ Width?: string;
1017
+ };
1018
+
1019
+ type CellStyleContent = TextBoxStyleContent & {
1020
+ LeftBorder?: BorderStyle;
1021
+ TopBorder?: BorderStyle;
1022
+ BottomBorder?: BorderStyle;
1023
+ RightBorder?: BorderStyle;
1024
+ TextAlign?: string;
1025
+ VerticalAlign?: string;
1026
+ };
1027
+
1028
+ type TextBoxStyleContent = {
1029
+ Color?: string;
1030
+ BackgroundColor?: string;
1031
+ FontFamily?: string;
1032
+ FontSize?: string;
1033
+ FontStyle?: string;
1034
+ FontWeight?: string;
1035
+ };
1036
+ type ContainerStyleContent = {
1037
+ BackgroundColor?: string;
1038
+ Border?: BorderStyle;
1039
+ };
1040
+ type BulletStyleContent = {
1041
+ ValueColor?: string;
1042
+ TargetLineColor?: string;
1043
+ LabelFontColor?: string;
1044
+ LabelFontFamily?: string;
1045
+ LabelFontSize?: string;
1046
+ LabelFontStyle?: string;
1047
+ TicksLineColor?: string;
1048
+ };
1049
+ type SparklineStyleContent = {
1050
+ LineColor?: string;
1051
+ FillColor?: string;
1052
+ GradientEndColor?: string;
1053
+ MarkerColor?: string;
1054
+ RangeFillColor?: string;
1055
+ RangeGradientEndColor?: string;
1056
+ };
1057
+ type TableStyleContent = {
1058
+ Header: { Rows: CellStyleContent[] };
1059
+ Details: { Rows: CellStyleContent[]; AlternatingExpression: string };
1060
+ Footer: { Rows: CellStyleContent[] };
1061
+ TableGroups: {
1062
+ Styles: {
1063
+ Header: { Rows: CellStyleContent[] };
1064
+ Footer: { Rows: CellStyleContent[] };
1065
+ }[];
1066
+ };
1067
+ Border?: BorderStyle;
1068
+ };
1069
+ type TableOfContentsStyleContent = {
1070
+ BackgroundColor?: string;
1071
+ Border?: BorderStyle;
1072
+ Levels: {
1073
+ Color?: string;
1074
+ PaddingLeft?: string;
1075
+ FontFamily?: string;
1076
+ FontSize?: string;
1077
+ FontStyle?: string;
1078
+ FontWeight?: string;
1079
+ };
1080
+ };
1081
+
1082
+ type ChartPaletteContent = string[];
1083
+
1084
+ type ReportStyles = {
1085
+ Bullet: ReportItemStyle<BulletStyleContent>;
1086
+ CheckBox: ReportItemStyle<TextBoxStyleContent>;
1087
+ FormattedText: ReportItemStyle<ContainerStyleContent>;
1088
+ InputField: ReportItemStyle<TextBoxStyleContent>;
1089
+ List: ReportItemStyle<ContainerStyleContent>;
1090
+ Rectangle: ReportItemStyle<ContainerStyleContent>;
1091
+ RichText: ReportItemStyle<TextBoxStyleContent>;
1092
+ Shape: ReportItemStyle<ContainerStyleContent>;
1093
+ Sparkline: ReportItemStyle<SparklineStyleContent>;
1094
+ Table: ReportItemStyle<TableStyleContent>;
1095
+ TableOfContents: ReportItemStyle<TableOfContentsStyleContent>;
1096
+ Tablix: ReportItemStyle<TableStyleContent>;
1097
+ TextBox: ReportItemStyle<TextBoxStyleContent>;
1098
+ ChartPalette: ReportItemStyle<ChartPaletteContent>;
1099
+ };
1100
+
1101
+ export type BarcodeSymbology = 'Ansi39' | 'Ansi39x' | 'BC412' | 'Codabar' | 'Code_11' | 'Code_128_A' | 'Code_128_B' | 'Code_128_C' | 'Code_128auto'
1102
+ | 'Code_2_of_5' | 'Code_93' | 'Code25intlv' | 'Code39' | 'Code39x' | 'Code49' | 'Code93x' | 'DataMatrix' | 'EAN_13' | 'EAN_8' | 'EAN128FNC1'
1103
+ | 'GS1QRCode' | 'HIBCCode128' | 'HIBCCode39' | 'IATA_2_of_5' | 'IntelligentMail' | 'IntelligentMailPackage' | 'ISBN' | 'ISMN' | 'ISSN'
1104
+ | 'ITF14' | 'JapanesePostal' | 'Matrix_2_of_5' | 'MaxiCode' | 'MicroPDF417' | 'MicroQRCode' | 'MSI' | 'Pdf417' | 'Pharmacode' | 'Plessey'
1105
+ | 'PostNet' | 'PZN' | 'QRCode' | 'RM4SCC' | 'RSS14' | 'RSS14Stacked' | 'RSS14StackedOmnidirectional' | 'RSS14Truncated' | 'RSSExpanded'
1106
+ | 'RSSExpandedStacked' | 'RSSLimited' | 'SSCC_18' | 'Telepen' | 'UCCEAN128' | 'UPC_A' | 'UPC_E0' | 'UPC_E1';
1107
+
1108
+ export type ViewerOptions = {
1109
+ /** element id where to render viewer */
1110
+ element: string;
1111
+
1112
+ /** locale passed by Designer */
1113
+ locale: 'en' | 'ja' | 'zh';
1114
+
1115
+ /** application title passed by Designer */
1116
+ applicationTitle: string;
1117
+
1118
+ /** information on the report to-be-previewed */
1119
+ reportInfo: {
1120
+ /** report id */
1121
+ id: string;
1122
+
1123
+ /** Report content in JSON format that can be useful for report viewers with in-browser rendering. */
1124
+ content: Report;
1125
+
1126
+ /** report name */
1127
+ name: string;
1128
+
1129
+ /** Specifies whether the report to-be-previewed is an existing report saved on server side. */
1130
+ isTemporary: boolean;
1131
+ };
1132
+ };
1133
+
1134
+ export type ReportTitleInfo = {
1135
+ /** Report name */
1136
+ reportName: string;
1137
+ /** Indicates whether the report has unsaved changes or not. */
1138
+ dirty: boolean;
1139
+ };
1140
+
1141
+ export type UpdateRouteOptions = {
1142
+ /** report id */
1143
+ id: string;
1144
+ };
1145
+
1146
+ export type AboutInfo = {
1147
+ /** Application title replaces **ActiveReports Web Designer** in all the places where it is used by default. */
1148
+ applicationTitle: string;
1149
+
1150
+ /** Compact application title is used in places where there is not enough space for a full title. */
1151
+ applicationTitleCompact: string;
1152
+
1153
+ /** application version */
1154
+ applicationVersion: string;
1155
+
1156
+ /** product title - can be overwritten */
1157
+ productTitle?: string;
1158
+
1159
+ /** product version - can be overwritten */
1160
+ productVersion?: string;
1161
+ };
1162
+
1163
+ export type HelpInfo = {
1164
+ /** help page title */
1165
+ title?: string;
1166
+
1167
+ /** help page URL */
1168
+ link: string;
1169
+ };
1170
+
1171
+ //
1172
+ export type CurrentReportInfo = {
1173
+ /**
1174
+ * report id
1175
+ *
1176
+ * If an existing report is edited, **id** is defined.\
1177
+ * Otherwise, if a new report is edited, **id** is **null**.
1178
+ */
1179
+ id: string | null;
1180
+
1181
+ /** report name */
1182
+ name: string;
1183
+ };
1184
+
1185
+ export type TemplateInfo = {
1186
+ /** report template name */
1187
+ name: string;
1188
+
1189
+ /** report template id */
1190
+ id?: string;
1191
+
1192
+ /** Report template content in JSON format that can be useful in case you would like to create a non-empty new report. */
1193
+ content?: ReportTemplate;
1194
+ };
1195
+
1196
+ export type CreateReportOptions = {
1197
+ /** template info - if it is specified for report creation, either **templateInfo.id** or **templateinfo.content** needs to be defined */
1198
+ templateInfo?: TemplateInfo;
1199
+
1200
+ /** data sets infos */
1201
+ dataSetsInfo?: {
1202
+ /** data set id */
1203
+ id: string;
1204
+
1205
+ /** data set name */
1206
+ name: string;
1207
+ }[];
1208
+
1209
+ /**
1210
+ * Name for new report, if not specified default 'Untitled' name will be used
1211
+ */
1212
+ name?: string;
1213
+
1214
+ /**
1215
+ * Which type of report to create
1216
+ */
1217
+ reportType?: 'FPL';
1218
+
1219
+ };
1220
+
1221
+ export type CreateReportInfo = {
1222
+ templateInfo?: TemplateInfo;
1223
+
1224
+ name: string;
1225
+ /**
1226
+ * undefined in onBeforeCreate handler
1227
+ * defined in onAfterCreate handler
1228
+ */
1229
+ success?: boolean;
1230
+ };
1231
+
1232
+ export type SaveReportInfo = {
1233
+ /**
1234
+ * If an existing report is to be overwritten on saving,
1235
+ * the correct id should be specified explicitly.
1236
+ */
1237
+ id?: string;
1238
+
1239
+ /**
1240
+ * The correct name needs to be always specified explicitly.
1241
+ */
1242
+ name: string;
1243
+
1244
+ /**
1245
+ * Indicates that a new report is being saved for the first time
1246
+ */
1247
+ isFirstSave: boolean;
1248
+
1249
+ /**
1250
+ * undefined in onBefore**** handlers
1251
+ * should be defined in onAfter****
1252
+ */
1253
+ success?: boolean;
1254
+ };
1255
+
1256
+ export type OpenReportInfo = {
1257
+ name: string;
1258
+ id: string;
1259
+ /**
1260
+ * undefined in onBefore**** handlers
1261
+ * should be defined in onAfter****
1262
+ */
1263
+ success?: boolean;
1264
+ };
1265
+
1266
+
1267
+ /**
1268
+ * Legacy API
1269
+ * Type of **GrapeCity.ActiveReports.WebDesigner** object exported by **web-designer.js** module.
1270
+ */
1271
+ export type DesignerApi = {
1272
+ /**
1273
+ * Creates the default **DesignerOptions** object to be passed to **renderApplication()** function.\
1274
+ * This object includes both required and optional Designer settings.
1275
+ *
1276
+ * **Example:**
1277
+ * ```javascript
1278
+ * var designerOptions = GrapeCity.ActiveReports.WebDesigner.createDesignerOptions();
1279
+ * ```
1280
+ */
1281
+ createDesignerOptions: () => DesignerOptions;
1282
+
1283
+ /**
1284
+ * Renders **Web Designer** to **<div>** element with id **designerElementId** using the specified **DesignerOptions** object.
1285
+ *
1286
+ * **Example:**
1287
+ * ```javascript
1288
+ * GrapeCity.ActiveReports.WebDesigner.renderApplication('designer-id', designerOptions);
1289
+ * ```
1290
+ *
1291
+ * @param designerElementId string
1292
+ * @param designerOptions DesignerOptions object
1293
+ */
1294
+ renderApplication: (designerElementId: string, designerOptions: DesignerOptions) => Promise<any>;
1295
+
1296
+ /**
1297
+ * Returns focus to Designer. Focus may be lost when plug-in components are opened/closed.\
1298
+ * Returning focus is essential to continue using Designer hotkeys like Ctrl+Z (undo), Ctrl+Y (redo), etc.
1299
+ *
1300
+ * **Example:**
1301
+ * ```javascript
1302
+ * GrapeCity.ActiveReports.WebDesigner.focus();
1303
+ * ```
1304
+ */
1305
+ focus: () => void;
1306
+
1307
+ /**
1308
+ * Returns **AboutInfo** object containing information about application name/version and product title/version.
1309
+ *
1310
+ * **Example:**
1311
+ * ```javascript
1312
+ * var aboutInfo = GrapeCity.ActiveReports.WebDesigner.getAboutInfo();
1313
+ * ```
1314
+ */
1315
+ getAboutInfo: () => AboutInfo;
1316
+
1317
+
1318
+ /**
1319
+ * Returns **HelpInfo[]** containing title/link pairs of Designer-related Help pages.
1320
+ *
1321
+ * **Example:**
1322
+ * ```javascript
1323
+ * var helpInfos = GrapeCity.ActiveReports.WebDesigner.getHelpInfos();
1324
+ * ```
1325
+ */
1326
+ getHelpInfos: () => HelpInfo[];
1327
+
1328
+ /**
1329
+ * This object includes functions allowing to create/open/save report, etc.
1330
+ */
1331
+ api: ReportingApi;
1332
+ };
1333
+
1334
+
1335
+ export type ReportingApi = {
1336
+ /**
1337
+ * Indicates whether report has unsaved changes.
1338
+ *
1339
+ * **Example:**
1340
+ * ```javascript
1341
+ * var hasUnsavedChanges = GrapeCity.ActiveReports.WebDesigner.api.isReportDirty();
1342
+ * if (hasUnsavedChanges) console.log('Currently edited report has unsaved changes.');
1343
+ * ```
1344
+ */
1345
+ isReportDirty: () => boolean;
1346
+
1347
+ /**
1348
+ * Returns information about the currently edited report.
1349
+ *
1350
+ * **Example:**
1351
+ * ```javascript
1352
+ * var reportInfo = GrapeCity.ActiveReports.WebDesigner.api.getReportInfo();
1353
+ * console.log(`Report "${reportInfo.name}" is currently edited.`);
1354
+ * ```
1355
+ */
1356
+ getReportInfo: () => CurrentReportInfo;
1357
+
1358
+ /**
1359
+ * Creates a new report to be edited in Designer using the specified **CreateReportOptions** object.
1360
+ *
1361
+ * **Example:**
1362
+ * ```javascript
1363
+ * GrapeCity.ActiveReports.WebDesigner.api.createReport({
1364
+ * onFinish: () => {
1365
+ * console.log('An empty RDL report is created.');
1366
+ * },
1367
+ * });
1368
+ * ```
1369
+ *
1370
+ * @param options CreateReportOptions object
1371
+ */
1372
+ createReport: (options: LegacyCreateReportOptions) => void;
1373
+
1374
+ /**
1375
+ * Opens anOpens an existing report to be edited in Designer using the specified **OpenReportOptions** object.
1376
+ *
1377
+ * **Example:**
1378
+ * ```javascript
1379
+ * GrapeCity.ActiveReports.WebDesigner.api.openReport({
1380
+ * reportInfo: {
1381
+ * id: 'MyReport.rdlx',
1382
+ * name: 'MyReport.rdlx',
1383
+ * },
1384
+ * onFinish: () => {
1385
+ * console.log('An existing report "MyReport.rdlx" is opened.');
1386
+ * },
1387
+ * });
1388
+ * ```
1389
+ *
1390
+ * @param options OpenReportOptions object
1391
+ */
1392
+ openReport: (options: LegacyOpenReportOptions) => void;
1393
+
1394
+ /**
1395
+ * Saves the report currently edited in Designer using the specified **SaveReportOptions** object.
1396
+ *
1397
+ * **Example:**
1398
+ * ```javascript
1399
+ * GrapeCity.ActiveReports.WebDesigner.api.saveReport({
1400
+ * reportInfo: {
1401
+ * name: 'MyReport.rdlx',
1402
+ * },
1403
+ * onFinish: () => {
1404
+ * console.log('A new report "MyReport.rdlx" is saved.');
1405
+ * },
1406
+ * });
1407
+ * ```
1408
+ *
1409
+ * @param options SaveReportOptions object
1410
+ */
1411
+ saveReport: (options: LegacySaveReportOptions) => void;
1412
+ };
1413
+
1414
+
1415
+ export type LegacyCreateReportOptions = {
1416
+ /** template info - if it is specified for report creation, either **id** or **content** needs to be defined */
1417
+ templateInfo?: {
1418
+ /** report template name */
1419
+ name: string;
1420
+
1421
+ /** report template id */
1422
+ id?: string;
1423
+
1424
+ /** Report template content in JSON format that can be useful in case you would like to create a non-empty new report. */
1425
+ content?: ReportTemplate;
1426
+ };
1427
+
1428
+ /** data sets infos */
1429
+ dataSets?: {
1430
+ /** data set id */
1431
+ id: string;
1432
+
1433
+ /** data set name */
1434
+ name: string;
1435
+ }[];
1436
+
1437
+ /** callback on starting to create a report */
1438
+ onStart?: () => void;
1439
+
1440
+ /** callback on finishing to create a report */
1441
+ onFinish?: () => void;
1442
+ };
1443
+
1444
+ export type LegacyOpenReportOptions = {
1445
+ reportInfo: {
1446
+ /** report name */
1447
+ name: string;
1448
+
1449
+ /** report id */
1450
+ id?: string;
1451
+
1452
+ /** report content in JSON format */
1453
+ content?: Report;
1454
+ };
1455
+
1456
+ /** callback on starting to open a report */
1457
+ onStart?: () => void;
1458
+
1459
+ /** callback on finishing to open a report */
1460
+ onFinish?: () => void;
1461
+ };
1462
+
1463
+ export type LegacySaveReportOptions = {
1464
+ /** report info */
1465
+ reportInfo: {
1466
+ /**
1467
+ * report id
1468
+ *
1469
+ * If an existing report is to be overwritten on saving, the correct **id** should be specified explicitly.
1470
+ */
1471
+ id?: string;
1472
+
1473
+ /** The correct name needs to be always specified explicitly. */
1474
+ name: string;
1475
+ };
1476
+
1477
+ /** callback on starting to save a report */
1478
+ onStart?: () => void;
1479
+
1480
+ /** callback on finishing to save a report */
1481
+ onFinish?: () => void;
1482
+ };
1483
+