@mescius/activereportsnet-viewer 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,1706 @@
1
+ declare class Color {
2
+ R: number;
3
+ G: number;
4
+ B: number;
5
+ A: number | undefined;
6
+ constructor(r: number, g: number, b: number, a?: number | undefined);
7
+ static fromHEX(color: string): Color;
8
+ }
9
+ type UITheme<T extends Record<string, string> = Record<string, string>> = {
10
+ name: string;
11
+ accent: Color;
12
+ accentText: Color;
13
+ accentSecondary: Color;
14
+ accentWarning: Color;
15
+ accentWarningText?: Color;
16
+ accentError: Color;
17
+ accentErrorText?: Color;
18
+ colorContrast: Color;
19
+ colorContrastText: Color;
20
+ backgroundBody: Color;
21
+ backgroundBodyOverlay?: Color;
22
+ backgroundPanels: Color;
23
+ backgroundPanelsSection?: Color;
24
+ backgroundPanelsBorder?: Color;
25
+ backgroundPanelsOverlay?: Color;
26
+ shadow: string;
27
+ shadowBorder: string;
28
+ overlay: Color;
29
+ textColor: Color;
30
+ textFamily?: string;
31
+ borderRadius: number;
32
+ elemBackground: Color;
33
+ elemBackgroundHover: Color;
34
+ btnGroupHeader: Color;
35
+ btnGroupHeaderHover: Color;
36
+ dropdownBackground: Color;
37
+ dropdownBackgroundHover?: Color;
38
+ dropdownBorder?: Color;
39
+ bindingModified?: Color;
40
+ bindingBound?: Color;
41
+ custom?: T;
42
+ };
43
+ declare const UIThemes: {
44
+ default: UITheme<Record<string, string>> | undefined;
45
+ defaultDark: UITheme<Record<string, string>> | undefined;
46
+ darkOled: UITheme<Record<string, string>> | undefined;
47
+ highContrast: UITheme<Record<string, string>> | undefined;
48
+ highContrastDark: UITheme<Record<string, string>> | undefined;
49
+ };
50
+
51
+ /** Type representing a viewer's sidebar instance. */
52
+ interface Sidebar {
53
+ /**
54
+ * Toggles the sidebar visibility.
55
+ * @param show Pass **true** to switch sidebar ON, and vise-versa. Do not pass any value to toggle visibility.
56
+ * @example Usage example:
57
+ * ```javascript
58
+ * viewer.sidebar.toggle(false); // hide sidebar
59
+ * ```
60
+ */
61
+ toggle: (show?: boolean) => void;
62
+ }
63
+
64
+ /**
65
+ * Default toolbar buttons.
66
+ * @example Usage example:
67
+ * ```javascript
68
+ * viewer.toolbar.desktop.layout([ToolbarButtons.Refresh, ToolbarButtons.Zoom, ToolbarButtons.Print]);
69
+ * ```
70
+ */
71
+ declare enum ToolbarButtons {
72
+ /** Toolbar items splitter. */
73
+ Splitter = "$split",
74
+ /** Pages navigation buttons group. */
75
+ Navigation = "$navigation",
76
+ /** Refresh report. */
77
+ Refresh = "$refresh",
78
+ /** Zoom controls group. */
79
+ Zoom = "$zoom",
80
+ /** Move tool button. */
81
+ MouseMode = "$mousemode",
82
+ /** Fullscreen switcher button. */
83
+ Fullscreen = "$fullscreen",
84
+ /** 'Go back', 'Go forward', 'Back to parent' buttons group. */
85
+ History = "$history",
86
+ /** Single page mode switcher button. */
87
+ SinglePageMode = "$singlepagemode",
88
+ /** Continuous mode switcher button. */
89
+ ContiniousMode = "$continuousmode",
90
+ /** Galley mode switcher button. */
91
+ GalleyMode = "$galleymode",
92
+ /** 'Print' button. */
93
+ Print = "$print"
94
+ }
95
+ /**
96
+ * Type representing a viewer's toolbar item.
97
+ * @example Usage example:
98
+ * ```javascript
99
+ * var pdfExportButton: ToolbarItem = {
100
+ * key: '$pdfExportButtonKey',
101
+ * checked: true,
102
+ * enabled: true,
103
+ * iconCssClass: 'mdi mdi-file-pdf',
104
+ * text: 'Export to PDF',
105
+ * title: 'Export to PDF',
106
+ * action: function(item) {
107
+ * console.log('Export to PDF function works here');
108
+ * },
109
+ * onUpdate: function(arg, item) {
110
+ * console.log('Something in viewer was updated, check/update button state here');
111
+ * }
112
+ * };
113
+ * viewer.toolbar.desktop.addItem(pdfExportButton);
114
+ * ```
115
+ */
116
+ interface ToolbarItem {
117
+ /**
118
+ * The uniq identifier of the toolbar item.
119
+ * See keys of the standard viewer's toolbar buttons here: [[ToolbarButtons]]
120
+ */
121
+ key: string;
122
+ /** Shows whether the toolbar item is checked. */
123
+ checked?: boolean;
124
+ /** Shows whether the toolbar item is enabled. */
125
+ enabled?: boolean;
126
+ /** Specifies css class for the icon of the toolbar item. */
127
+ iconCssClass?: string;
128
+ /** Specifies the text of the toolbar item. */
129
+ text?: string;
130
+ /** Specifies the tooltip of the toolbar item. */
131
+ title?: string;
132
+ /** Action handler for the toolbar item. */
133
+ action: () => void;
134
+ /** The function called to update toolbar item state. */
135
+ onUpdate: () => ToolbarItem;
136
+ }
137
+ interface ToolbarItems {
138
+ /** Adds a new item to the toolbar.
139
+ * @param item An item to be added.
140
+ * @example Usage example:
141
+ * ```javascript
142
+ * var pdfExportButton = {
143
+ * key: '$pdfExportButtonKey',
144
+ * iconCssClass: 'mdi mdi-file-pdf',
145
+ * enabled: true,
146
+ * action: function(item) {
147
+ * console.log('Export to PDF function works here');
148
+ * },
149
+ * onUpdate: function(arg, item) {
150
+ * console.log('Something in viewer was updated, check/update button state here');
151
+ * }
152
+ * };
153
+ * viewer.toolbar.desktop.addItem(pdfExportButton);
154
+ * ```
155
+ */
156
+ addItem: (item: ToolbarItem) => void;
157
+ /** Updates a previously added toolbar item.
158
+ *
159
+ * @param key the toolbar item key, as it was specified in the addItem parameters.
160
+ * @param itemUpdate New toolbar item settings.
161
+ */
162
+ updateItem: (key: string, itemUpdate: ToolbarItem) => void;
163
+ /** Removes existing item from the toolbar.
164
+ * @param key The toolbar item key, as it was specified in the addItem parameters.
165
+ * @example Usage example:
166
+ * ```javascript
167
+ * viewer.toolbar.desktop.removeItem(pdfExportButton);
168
+ * ```
169
+ */
170
+ removeItem: (key: string) => void;
171
+ /**
172
+ * Returns identifiers of default and added buttons in the order in which they will be displayed in the toolbar.
173
+ * @example Usage example:
174
+ * ```javascript
175
+ * viewer.toolbar.desktop.layout(viewer.toolbar.desktop.getKeys().reverse())
176
+ * ```
177
+ */
178
+ getKeys: () => string[];
179
+ /** Sets the keys of the visible toolbar items and their order.
180
+ * @param keys The array of the keys of toolbar items to be visible on toolbar in the desired order.
181
+ * @example Usage example:
182
+ * ```javascript
183
+ * viewer.toolbar.desktop.addItem(pdfExportButton);
184
+ * // now you want to remove everything except pdfExportButton and the navigation block.
185
+ * viewer.toolbar.desktop.layout(['$pdfExportButtonKey', '$navigation']);
186
+ * ```
187
+ * will create a toolbar with the export button and the "navigation" block.
188
+ */
189
+ layout: (keys: string[]) => void;
190
+ }
191
+ /** Type representing a viewer's toolbar instance. */
192
+ interface Toolbar {
193
+ /**
194
+ * Toggles the toolbar visibility.
195
+ * @param show Pass **true** to switch toolbar ON, and vise-versa. Do not pass any value to toggle visibility.
196
+ * @example Usage example:
197
+ * ```javascript
198
+ * viewer.toolbar.toggle(false); // hide toolbar
199
+ * ```
200
+ */
201
+ toggle: (show?: boolean) => void;
202
+ /**
203
+ * Desktop layout toolbar items.
204
+ * @example Usage example:
205
+ * ```javascript
206
+ * viewer.toolbar.desktop.addItem({
207
+ * key: 'coolButton',
208
+ * title: 'Cool Button',
209
+ * iconCssClass: 'mdi mdi-emoticon-cool',
210
+ * action: () => {
211
+ * console.log('Cool!');
212
+ * }}
213
+ * )
214
+ * ```
215
+ */
216
+ desktop: ToolbarItems;
217
+ /**
218
+ * Mobile layout toolbar items.
219
+ * @example Usage example:
220
+ * ```javascript
221
+ * viewer.toolbar.mobile.addItem({
222
+ * key: 'pizzaButton',
223
+ * title: 'Cool Pizza',
224
+ * iconCssClass: 'mdi mdi-pizza',
225
+ * action: () => {
226
+ * console.log('Pizza Time!');
227
+ * }}
228
+ * )
229
+ * ```
230
+ */
231
+ mobile: ToolbarItems;
232
+ /**
233
+ * Fullscreen mode toolbar items.
234
+ * @example Usage example:
235
+ * ```javascript
236
+ * viewer.toolbar.fullscreen.addItem({
237
+ * key: 'fishButton',
238
+ * title: 'Fish',
239
+ * iconCssClass: 'mdi mdi-fish',
240
+ * action: () => {
241
+ * console.log('Just a fish.');
242
+ * }}
243
+ * )
244
+ * ```
245
+ */
246
+ fullscreen: ToolbarItems;
247
+ }
248
+
249
+ /** Report types. */
250
+ declare enum ReportType {
251
+ Section = 0,
252
+ Page = 1,
253
+ Rdl = 2
254
+ }
255
+ /** All supported exports. */
256
+ type ExportTypes = 'Pdf' | 'Xlsx' | 'Xls' | 'Doc' | 'Docx' | 'Rtf' | 'Json' | 'Xml' | 'Csv' | 'Txt' | 'Tiff' | 'Mht' | 'XlsxData' | 'CsvData' | 'TextPrint';
257
+ /** Describes the parameter value. */
258
+ interface ParameterValue {
259
+ label: string;
260
+ value: any;
261
+ }
262
+ /** Describes the parameter. */
263
+ interface ParameterDescriptor {
264
+ name: string;
265
+ prompt: string;
266
+ dataType: any;
267
+ selectAllValue: any;
268
+ allowBlank: boolean;
269
+ nullable: boolean;
270
+ multiValue: boolean;
271
+ multiline: boolean;
272
+ hidden: boolean;
273
+ usedInQuery: boolean;
274
+ dateOnly: boolean;
275
+ dependsOn: string[];
276
+ validValues: ParameterValue;
277
+ defaultValue: ParameterValue;
278
+ displayFormat: string;
279
+ actualDefaultValues: ParameterValue[];
280
+ }
281
+ /** Describes the report. */
282
+ interface ReportInfo {
283
+ /** The name of the report. */
284
+ name: string;
285
+ /** The parameters of the report. */
286
+ parameters: ParameterDescriptor[];
287
+ /** Contains layout for custom parameters panel. */
288
+ parametersView: string;
289
+ /** The display type of the report. */
290
+ displayType: ViewMode;
291
+ /** Indicates whether GalleyMode is allowed. */
292
+ galleyModeAllowed: boolean;
293
+ /** The size type of the report. */
294
+ sizeType: SizeType;
295
+ /** Export types available for a given report. */
296
+ exports: ExportTypes[];
297
+ /**The type of the report. */
298
+ type: ReportType;
299
+ /** The preffered type of viewer to use. */
300
+ viewerType: ViewerType;
301
+ /** List of report section names*/
302
+ sections: string[];
303
+ }
304
+ /**
305
+ * Report:
306
+ * Uses standard UI and default rendering settings
307
+ * Dashboard:
308
+ * Uses dashboard UI and dashboard rendering settings, which include:
309
+ * rendering all pages in galley mode, with report background color as viewer area background
310
+ */
311
+ type ViewerType = 'Report' | 'Dashboard';
312
+ /** All supported paging modes. */
313
+ type ViewMode = 'Single' | 'Continuous';
314
+ /** Report render modes. */
315
+ type RenderMode = 'Paginated' | 'Galley';
316
+ /** Report render backend. */
317
+ type RenderFormat = 'auto' | 'html' | 'svg';
318
+ /** All supported size types. */
319
+ type SizeType = 'Default' | 'FitToWidth' | 'FitToPage' | 'Stretch';
320
+ /** Describes the initial zoom percentage value. */
321
+ type Percentage = {
322
+ percentage: number;
323
+ };
324
+ /** All supported initial zoom modes. */
325
+ type InitialZoomMode = 'FitToPage' | 'FitToWidth' | Percentage;
326
+ /** Export callback */
327
+ type ExportCallback = (uri: string) => void;
328
+ /** Describes the parameter value used to run the report. */
329
+ interface Parameter {
330
+ /** The name of the parameter. */
331
+ name: string;
332
+ /** The value(s) of the parameter. */
333
+ values: string[];
334
+ }
335
+ /** Describes the search options. */
336
+ interface SearchOptions {
337
+ /** Whether the search should respect the case. */
338
+ matchCase: boolean;
339
+ /** Whether the search should look for a whole phrase. */
340
+ wholePhrase: boolean;
341
+ }
342
+ /** Describes the error severity. */
343
+ type ErrorSeverity = 'error' | 'warn' | 'info' | 'debug';
344
+ /** Describes the error. */
345
+ interface ErrorInfo {
346
+ /** Error message. */
347
+ message: string;
348
+ /** Error details. */
349
+ details: string;
350
+ /** Error severity. */
351
+ severity: ErrorSeverity;
352
+ }
353
+ /** Describes the settings for parameters panel. */
354
+ interface ParametersPanelSettings {
355
+ /**
356
+ * Adjusts the position of the parameters panel.
357
+ * @example Usage example:
358
+ * ```javascript
359
+ * location: 'top'
360
+ * ```
361
+ * Adjusts the opening mode of the parameters panel.
362
+ * @example Usage example:
363
+ * ```javascript
364
+ * open: 'always'
365
+ * ```
366
+ */
367
+ location: 'top' | 'default';
368
+ open: 'always' | 'auto';
369
+ }
370
+ /** Describes the position of panels (search, parameters etc). */
371
+ type PanelsLocation = 'sidebar' | 'toolbar';
372
+ /** Describes the settings to connect the Web API. */
373
+ interface ReportServiceSettings {
374
+ /**
375
+ * The url to connect the Web API.
376
+ * @example Usage example (prefix only):
377
+ * ```javascript
378
+ * url: '/api/reporting' // default value
379
+ * ```
380
+ * @example Usage example (full URL):
381
+ * ```javascript
382
+ * url: 'http:example.com/api/reporting'
383
+ * ```
384
+ */
385
+ url?: string;
386
+ /**
387
+ * The security key needed to access the Web API.
388
+ * @example Usage example:
389
+ * ```javascript
390
+ * securityToken: 'security_token',
391
+ * ```
392
+ */
393
+ securityToken?: string;
394
+ /**
395
+ * Callback before any request.
396
+ * Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.
397
+ * @example Usage example:
398
+ * ```javascript
399
+ onRequestAsync: (init) => {
400
+ return new Promise((resolve, reject) => {
401
+ init.headers.Authorization = 'security_token';
402
+ return resolve(init);
403
+ });
404
+ * ```
405
+ */
406
+ onRequestAsync?: (init: RequestInit) => Promise<RequestInit>;
407
+ /**
408
+ * Callback before any request.
409
+ * Allows to change RequestInit object before fetch request - https://fetch.spec.whatwg.org/#requestinit.
410
+ * @example Usage example:
411
+ * ```javascript
412
+ onRequest: (init) => init.headers.Authorization = 'security_token';
413
+ * ```
414
+ */
415
+ onRequest?: Function;
416
+ }
417
+ /** Describes custom default settings. */
418
+ interface DefaultExportSettings {
419
+ [exportFormat: string]: {
420
+ [settingName: string]: {
421
+ value?: string | boolean | number;
422
+ visible?: boolean;
423
+ };
424
+ };
425
+ }
426
+ /** Describes page view options. */
427
+ interface PageViewOptions {
428
+ /** Defines horizontal alignment for report page inside view area */
429
+ horizontalAlignment?: 'left' | 'right' | 'center';
430
+ /** Specifies how the report page is shown inside the viewer.
431
+ * If value is 'standard' the page rendered on the virtual paper which placed on the gray virtual desktop.
432
+ * If value is 'noPaper' the page rendered whithout gray area arond.
433
+ * */
434
+ viewMode?: 'standard' | 'noPaper';
435
+ }
436
+ /** Describes animation that can be applied to the report view */
437
+ interface AnimationOptions {
438
+ loadChart?: LoadChartAnimationOptions;
439
+ hoverChart?: HoverChartAnimationOptions;
440
+ hoverTable?: HoverTableAnimationOptions;
441
+ }
442
+ interface HoverTableAnimationOptions {
443
+ /**
444
+ * Enable hover table and tablix animation. Default value: false.
445
+ * @example
446
+ * enabled: true
447
+ */
448
+ enabled?: boolean;
449
+ /**
450
+ * Specifies the background color on hover over the table and tablix row. Default value: 'LightGray'.
451
+ * @example
452
+ * backgroundColor: 'LightGray'
453
+ */
454
+ backgroundColor?: string;
455
+ /**
456
+ * Specifies the text color on hover over the table and tablix row. Default value: `undefined`.\
457
+ * If the value is `undefined`, text color of row cells remains unchanged on hover.
458
+ * @example
459
+ * textColor: 'DarkGray'
460
+ */
461
+ textColor?: string;
462
+ }
463
+ /** Describes load chart animation that can be applied to the report view. */
464
+ type LoadChartAnimationOptions = {
465
+ /**
466
+ * Enable load chart animation. Default value: false.
467
+ * @example
468
+ * enabled: true
469
+ */
470
+ enabled?: boolean;
471
+ };
472
+ /** Describes hover chart animation that can be applied to the report view. */
473
+ type HoverChartAnimationOptions = {
474
+ /**
475
+ * Enable hover chart animation. Default value: false.
476
+ * @example
477
+ * enabled: true
478
+ */
479
+ enabled?: boolean;
480
+ };
481
+ /** The following options can be set during initialization or at run time while working with the JS Viewer. */
482
+ interface InitializationOptions {
483
+ /**
484
+ * The callback that is invoked before the JS Viewer opens the hyperlink, bookmark link,
485
+ * drill down report or toggles the report control visibility.
486
+ * @example Usage example:
487
+ * ```javascript
488
+ * // ESM usage
489
+ * import { createViewer } from './jsViewer.min.js';
490
+ * const viewer = createViewer({
491
+ * action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
492
+ * });
493
+ * ```
494
+ * @example Usage example:
495
+ * ```javascript
496
+ * // UMD usage
497
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
498
+ * action: (actionType, actionParams) => console.log('Action type: ' + actionType + '; Action parameters: ' + actionParams)
499
+ * });
500
+ * ```
501
+ */
502
+ action?: (actionType: string, actionParams: any[]) => void;
503
+ /** The report view animation options.
504
+ * @example Usage example:
505
+ * ```javascript
506
+ * // ESM usage
507
+ * import { createViewer } from './jsViewer.min.js';
508
+ * const viewer = createViewer({
509
+ * animation: {
510
+ * loadChart: {
511
+ * enabled: true
512
+ * },
513
+ * hoverChart: {
514
+ * enabled: true
515
+ * },
516
+ * hoverTable: {
517
+ * enabled: true,
518
+ * backgroundColor: 'LightGray',
519
+ * textColor: 'DarkGray'
520
+ * }
521
+ * }
522
+ * });
523
+ * ```
524
+ * @example Usage example:
525
+ * ```javascript
526
+ * // UMD usage
527
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
528
+ * animation: {
529
+ * loadChart: {
530
+ * enabled: true
531
+ * },
532
+ * hoverChart: {
533
+ * enabled: true
534
+ * },
535
+ * hoverTable: {
536
+ * enabled: true,
537
+ * backgroundColor: 'LightGray',
538
+ * textColor: 'DarkGray'
539
+ * }
540
+ * }
541
+ * });
542
+ * ```
543
+ */
544
+ animation?: AnimationOptions;
545
+ /**
546
+ * When true, view area background color is filled with report body color
547
+ * available only for dashboard reports
548
+ * @example Usage example:
549
+ * ```javascript
550
+ * // ESM usage
551
+ * import { createViewer } from './jsViewer.min.js';
552
+ * const viewer = createViewer({
553
+ * autoBackgroundColor : true;
554
+ * });
555
+ * ```
556
+ * @example Usage example:
557
+ * ```javascript
558
+ * // UMD usage
559
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
560
+ * autoBackgroundColor : true;
561
+ * });
562
+ * ```
563
+ */
564
+ autoBackgroundColor?: boolean;
565
+ /**
566
+ * The array of export types available via Export functionality of JS Viewer. By default,
567
+ * Mht, Pdf, Tiff, Xls, Xlsx, Csv, Doc, Docx, Json, Xml, TextPrint, XlsxData and CsvData exports are available for page reports,
568
+ * Mht, Pdf, Tiff, Xls, Xlsx, Rtf and Txt exports are available for section reports.
569
+ * @example Usage example:
570
+ * ```javascript
571
+ * // ESM usage
572
+ * import { createViewer } from './jsViewer.min.js';
573
+ * const viewer = createViewer({
574
+ * availableExports: ['Xml', 'Pdf']
575
+ * });
576
+ * ```
577
+ * @example Usage example:
578
+ * ```javascript
579
+ * // UMD usage
580
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
581
+ * availableExports: ['Xml', 'Pdf']
582
+ * });
583
+ * ```
584
+ */
585
+ availableExports?: ExportTypes[];
586
+ /**
587
+ * The object containing custom default export settings. Use to set default value and visibility of any field in the export panel.
588
+ * Format keys are mht, pdf, tiff, xls, xlsx, csv, doc, docx, json, xml, xlsxData, csvData, rtf and txt.
589
+ * Settings' keys are the export settings which are available for RenderingExtensions.
590
+ * @example Usage example:
591
+ * ```javascript
592
+ * // ESM usage
593
+ * import { createViewer } from './jsViewer.min.js';
594
+ * const viewer = createViewer({
595
+ * defaultExportSettings: {
596
+ * xls: {
597
+ * FileName: {
598
+ * value: "Hihihi",
599
+ * visible: false
600
+ * }
601
+ * }
602
+ * }
603
+ * });
604
+ * ```
605
+ * @example Usage example:
606
+ * ```javascript
607
+ * // UMD usage
608
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
609
+ * defaultExportSettings: {
610
+ * xls: {
611
+ * FileName: {
612
+ * value: "Hihihi",
613
+ * visible: false
614
+ * }
615
+ * }
616
+ * }
617
+ * });
618
+ * ```
619
+ */
620
+ defaultExportSettings?: DefaultExportSettings;
621
+ /**
622
+ * Set up single page or continuous page.
623
+ * @example Usage example:
624
+ * ```javascript
625
+ * // ESM usage
626
+ * import { createViewer } from './jsViewer.min.js';
627
+ * const viewer = createViewer({
628
+ * displayMode: 'Continuous'
629
+ * });
630
+ * ```
631
+ * @example Usage example:
632
+ * ```javascript
633
+ * // UMD usage
634
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
635
+ * displayMode: 'Continuous'
636
+ * });
637
+ * ```
638
+ */
639
+ displayMode?: ViewMode;
640
+ /**
641
+ * The callback that is invoked when a document is loaded entirely on the server.
642
+ * @example Usage example:
643
+ * ```javascript
644
+ * // ESM usage
645
+ * import { createViewer } from './jsViewer.min.js';
646
+ * const viewer = createViewer({
647
+ * documentLoaded: () => console.log('The document is loaded entirely on the server')
648
+ * });
649
+ * ```
650
+ * @example Usage example:
651
+ * ```javascript
652
+ * // UMD usage
653
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
654
+ * documentLoaded: () => console.log('The document is loaded entirely on the server')
655
+ * });
656
+ * ```
657
+ */
658
+ documentLoaded?: () => void;
659
+ /**
660
+ * JQuery selector that specifies the element that hosts the JS Viewer control.
661
+ * @example Usage example:
662
+ * ```javascript
663
+ * // ESM usage
664
+ * import { createViewer } from './jsViewer.min.js';
665
+ * const viewer = createViewer({
666
+ * element: '#viewerContainer'
667
+ * });
668
+ * ```
669
+ * @example Usage example:
670
+ * ```javascript
671
+ * // UMD usage
672
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
673
+ * element: '#viewerContainer'
674
+ * });
675
+ * ```
676
+ */
677
+ element: string;
678
+ /**
679
+ * The callback that is invoked when an error occurs in the process of displaying the report.
680
+ * The default error panel does not appear if the callback doesn't reurn proper object.
681
+ * The error parameter is an object that has a message property which allows the users to customize
682
+ * the error message and caption property which allows to customize error caption.
683
+ * @example To hide the default error panel:
684
+ * ```javascript
685
+ * // ESM usage
686
+ * import { createViewer } from './jsViewer.min.js';
687
+ * const viewer = createViewer({
688
+ * error: (error) => {
689
+ * if (error.message) {
690
+ * // show error message.
691
+ * alert("Internal error! Please ask administrator.");
692
+ * // do not show default error message.
693
+ * return true;
694
+ * }
695
+ * }
696
+ * });
697
+ * ```
698
+ * @example To hide the default error panel:
699
+ * ```javascript
700
+ * // UMD usage
701
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
702
+ * error: (error) => {
703
+ * if (error.message) {
704
+ * // show error message.
705
+ * alert("Internal error! Please ask administrator.");
706
+ * // do not show default error message.
707
+ * return true;
708
+ * }
709
+ * }
710
+ * });
711
+ * ```
712
+ */
713
+ error?: (error: ErrorInfo) => boolean;
714
+ /**
715
+ * Set up the initial zoom mode.
716
+ * @example Usage example:
717
+ * ```javascript
718
+ * // ESM usage
719
+ * import { createViewer } from './jsViewer.min.js';
720
+ * const viewer = createViewer({
721
+ * initialZoomMode: 'FitToWidth';
722
+ * });
723
+ * ```
724
+ * @example Usage example:
725
+ * ```javascript
726
+ * // UMD usage
727
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
728
+ * initialZoomMode: 'FitToWidth';
729
+ * });
730
+ * ```
731
+ */
732
+ initialZoomMode?: InitialZoomMode;
733
+ /**
734
+ * Specifies locale used for displaying Viewer.
735
+ * If **locale** is not specified explicitly here, the locale corresponding to the browser preferences is used.
736
+ * @example Usage example:
737
+ * ```javascript
738
+ * // ESM usage
739
+ * import { createViewer } from './jsViewer.min.js';
740
+ * const viewer = createViewer({
741
+ * locale: 'ja-JP'
742
+ * });
743
+ * ```
744
+ * @example Usage example:
745
+ * ```javascript
746
+ * // UMD usage
747
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
748
+ * locale: 'ja-JP'
749
+ * });
750
+ * ```
751
+ */
752
+ locale?: string;
753
+ /**
754
+ * The JSON containing the localization strings.
755
+ * Not all strings are necessary — missing values ​​will be displayed using EN localization data.
756
+ * @example Usage example:
757
+ * ```javascript
758
+ * // ESM usage
759
+ * import { createViewer } from './jsViewer.min.js';
760
+ * const viewer = createViewer({
761
+ * localeData: JSON.parse( `{
762
+ * "export": {
763
+ * "boolTextFalse": "Нет",
764
+ * "boolTextTrue": "Да"
765
+ * },
766
+ * "viewer": {
767
+ * "toolbar": {
768
+ * "refresh": "Обновить"
769
+ * }
770
+ * }
771
+ * }`
772
+ * )
773
+ *});
774
+ * ```
775
+ * @example Usage example:
776
+ * ```javascript
777
+ * // UMD usage
778
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
779
+ * localeData: JSON.parse( `{
780
+ * "export": {
781
+ * "boolTextFalse": "Нет",
782
+ * "boolTextTrue": "Да"
783
+ * },
784
+ * "viewer": {
785
+ * "toolbar": {
786
+ * "refresh": "Обновить"
787
+ * }
788
+ * }
789
+ * }`
790
+ * )
791
+ *});
792
+ * ```
793
+ */
794
+ localeData?: JSON;
795
+ /**
796
+ * The url of the file containing the localization strings.
797
+ * Not all strings are necessary — missing values ​​will be displayed using EN localization data.
798
+ * @example Usage example:
799
+ * ```javascript
800
+ * // ESM usage
801
+ * import { createViewer } from './jsViewer.min.js';
802
+ * const viewer = createViewer({
803
+ * localeUri: './locale.json'
804
+ * });
805
+ * ```
806
+ * locale.json:
807
+ * ```json
808
+ * {
809
+ * "export": {
810
+ * "boolTextFalse": "Нет",
811
+ * "boolTextTrue": "Да",
812
+ * ...
813
+ * },
814
+ * "exportcsv": {
815
+ * "friendlyName": "-CSV-",
816
+ * "settings": {
817
+ * "ColumnsDelimiter": {
818
+ * "label": "Разделитель Столбцов",
819
+ * "category": "Прочее"
820
+ * },
821
+ * ...
822
+ * },
823
+ * ...
824
+ * },
825
+ * ...
826
+ * }
827
+ * ```
828
+ * @example Usage example:
829
+ * ```javascript
830
+ * // UMD usage
831
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
832
+ * localeUri: './locale.json'
833
+ * });
834
+ * ```
835
+ * locale.json:
836
+ * ```json
837
+ * {
838
+ * "export": {
839
+ * "boolTextFalse": "Нет",
840
+ * "boolTextTrue": "Да",
841
+ * ...
842
+ * },
843
+ * "exportcsv": {
844
+ * "friendlyName": "-CSV-",
845
+ * "settings": {
846
+ * "ColumnsDelimiter": {
847
+ * "label": "Разделитель Столбцов",
848
+ * "category": "Прочее"
849
+ * },
850
+ * ...
851
+ * },
852
+ * ...
853
+ * },
854
+ * ...
855
+ * }
856
+ * ```
857
+ */
858
+ localeUri?: string;
859
+ /** Defines horizontal alignment and view for report page like part of the WebPage or 'paper view'
860
+ * @example Usage example:
861
+ * ```javascript
862
+ * // ESM usage
863
+ * import { createViewer } from './jsViewer.min.js';
864
+ * const viewer = createViewer({
865
+ * pageView: {
866
+ * horizontalAlignment: 'left',
867
+ * viewMode: 'standard'
868
+ * }
869
+ * });
870
+ * ```
871
+ * @example Usage example:
872
+ * ```javascript
873
+ * // UMD usage
874
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
875
+ * pageView: {
876
+ * horizontalAlignment: 'left',
877
+ * viewMode: 'standard'
878
+ * }
879
+ * });
880
+ * ```
881
+ */
882
+ pageView?: PageViewOptions;
883
+ /**
884
+ * Set up the parameters panel settings.
885
+ * @example Usage example:
886
+ * ```javascript
887
+ * // ESM usage
888
+ * import { createViewer } from './jsViewer.min.js';
889
+ * const viewer = createViewer({
890
+ * parametersPanel: {
891
+ * * location: 'top',
892
+ * * open: 'always'
893
+ * }});
894
+ * ```
895
+ * @example Usage example:
896
+ * ```javascript
897
+ * // UMD usage
898
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
899
+ * parametersPanel: {
900
+ * * location: 'top',
901
+ * * open: 'always'
902
+ * }});
903
+ * ```
904
+ */
905
+ parametersPanel?: ParametersPanelSettings;
906
+ /**
907
+ * The position of panels (search, parameters etc): 'toolbar' or 'sidebar'. Default value is 'toolbar'.
908
+ * @example Usage example:
909
+ * ```javascript
910
+ * // ESM usage
911
+ * import { createViewer } from './jsViewer.min.js';
912
+ * const viewer = createViewer({
913
+ * panelsLocation: 'sidebar'
914
+ * });
915
+ * ```
916
+ * @example Usage example:
917
+ * ```javascript
918
+ * // UMD usage
919
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
920
+ * panelsLocation: 'sidebar'
921
+ * });
922
+ * ```
923
+ */
924
+ panelsLocation?: PanelsLocation;
925
+ /**
926
+ * Set up render mode: 'auto', 'html' or 'svg'
927
+ * @example Usage example:
928
+ * ```javascript
929
+ * // ESM usage
930
+ * import { createViewer } from './jsViewer.min.js';
931
+ * const viewer = createViewer({
932
+ * renderFormat : 'auto'
933
+ * });
934
+ * ```
935
+ * @example Usage example:
936
+ * ```javascript
937
+ * // UMD usage
938
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
939
+ * renderFormat : 'auto'
940
+ * });
941
+ * ```
942
+ */
943
+ renderFormat?: RenderFormat;
944
+ /**
945
+ * Set up initial render mode: 'Paginated' or 'Galley'. Default value is 'Paginated'.
946
+ * @example Usage example:
947
+ * ```javascript
948
+ * import { createViewer } from './jsViewer.min.js';
949
+ * const viewer = createViewer({
950
+ * renderMode: 'Galley'
951
+ * });
952
+ * ```
953
+ * @example Usage example:
954
+ * ```javascript
955
+ * // UMD usage
956
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
957
+ * renderMode: 'Galley'
958
+ * });
959
+ * ```
960
+ */
961
+ renderMode?: RenderMode;
962
+ /**
963
+ * The id of the report to be shown by the JS Viewer.
964
+ * @example Usage example:
965
+ * ```javascript
966
+ * // ESM usage
967
+ * import { createViewer } from './jsViewer.min.js';
968
+ * const viewer = createViewer({
969
+ * reportID: 'AnnualReport.rdlx'
970
+ * });
971
+ * ```
972
+ * @example Usage example:
973
+ * ```javascript
974
+ * // UMD usage
975
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
976
+ * reportID: 'AnnualReport.rdlx'
977
+ * });
978
+ * ```
979
+ */
980
+ reportID?: string;
981
+ /**
982
+ * The callback that is invoked when the JS Viewer obtains the information about the requested report.
983
+ * @example Usage example:
984
+ * ```javascript
985
+ * // ESM usage
986
+ * import { createViewer } from './jsViewer.min.js';
987
+ * const viewer = createViewer({
988
+ * reportLoaded: (reportInfo) => console.log('The report ' + reportInfo.name + ' was successfully loaded!')
989
+ * });
990
+ * ```
991
+ * @example Usage example:
992
+ * ```javascript
993
+ * // UMD usage
994
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
995
+ * reportLoaded: (reportInfo) => console.log('The report ' + reportInfo.name + ' was successfully loaded!')
996
+ * });
997
+ * ```
998
+ */
999
+ reportLoaded?: (reportInfo: ReportInfo) => void;
1000
+ /**
1001
+ * The array of the {name, value} pairs that describe the parameters values used to run the report.
1002
+ * @example Usage example:
1003
+ * ```javascript
1004
+ * // ESM usage
1005
+ * import { createViewer } from './jsViewer.min.js';
1006
+ * const viewer = createViewer({
1007
+ * reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
1008
+ * });
1009
+ * ```
1010
+ * @example Usage example:
1011
+ * ```javascript
1012
+ * // UMD usage
1013
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1014
+ * reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
1015
+ * });
1016
+ * ```
1017
+ */
1018
+ reportParameters?: Parameter[];
1019
+ /**
1020
+ * Set up the settings to connect the Web API.
1021
+ * @example Usage example:
1022
+ * ```javascript
1023
+ * // ESM usage
1024
+ * import { createViewer } from './jsViewer.min.js';
1025
+ * const viewer = createViewer({
1026
+ * reportService: {
1027
+ * url: 'http://example.com/api/reporting',
1028
+ * securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
1029
+ * }
1030
+ * });
1031
+ * ```
1032
+ * @example Usage example:
1033
+ * ```javascript
1034
+ * // UMD usage
1035
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1036
+ * reportService: {
1037
+ * url: 'http://example.com/api/reporting',
1038
+ * securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
1039
+ * }
1040
+ * });
1041
+ * ```
1042
+ */
1043
+ reportService?: ReportServiceSettings;
1044
+ /**
1045
+ * JQuery selector that specifies the element that hosts the JS Viewer control.
1046
+ * @example Usage example:
1047
+ * ```javascript
1048
+ * // ESM usage
1049
+ * import { createViewer } from './jsViewer.min.js';
1050
+ * const viewer = createViewer({
1051
+ * silentPrint: true
1052
+ * });
1053
+ * ```
1054
+ * @example Usage example:
1055
+ * ```javascript
1056
+ * // UMD usage
1057
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1058
+ * silentPrint: true
1059
+ * });
1060
+ * ```
1061
+ */
1062
+ silentPrint?: boolean;
1063
+ /**
1064
+ * Viewer's UI theme.
1065
+ * @example Pre-defined theme selection USM example:
1066
+ * ```javascript
1067
+ * // ESM usage
1068
+ * import {createViewer, UIThemes} from './jsViewer.min.js';
1069
+ * const viewer = createViewer({
1070
+ * element: '#root',
1071
+ * theme: UIThemes.defaultDark
1072
+ * });
1073
+ * ```
1074
+ *
1075
+ * @example Pre-defined theme selection example:
1076
+ * ```javascript
1077
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1078
+ * theme: GrapeCity.ActiveReports.JSViewer.Themes.darkOled
1079
+ * });
1080
+ * ```
1081
+ */
1082
+ theme?: UITheme;
1083
+ }
1084
+ /** The following options can be set during initialization or at run time while working with the JS Viewer. */
1085
+ interface ExportOptions extends PrintOptions {
1086
+ /**
1087
+ * The document format type to report be exported to.
1088
+ * @example Usage example:
1089
+ * ```javascript
1090
+ * // ESM usage
1091
+ * import {exportReport} from './jsViewer.min.js';
1092
+ * exportReport({
1093
+ * exportType: 'Pdf'
1094
+ * });
1095
+ * ```
1096
+ * @example Usage example:
1097
+ * ```javascript
1098
+ * // UMD usage
1099
+ * GrapeCity.ActiveReports.JSViewer.export({
1100
+ * exportType: 'Pdf'
1101
+ * });
1102
+ * ```
1103
+ */
1104
+ exportType: ExportTypes;
1105
+ /**
1106
+ * The callback that is invoked before the export result request sent.
1107
+ * @example Usage example:
1108
+ * ```javascript
1109
+ * // ESM usage
1110
+ * import {exportReport} from './jsViewer.min.js';
1111
+ * exportReport({
1112
+ * callback: ()=>console.log('test')
1113
+ * });
1114
+ * ```
1115
+ * @example Usage example:
1116
+ * ```javascript
1117
+ * // UMD usage
1118
+ * GrapeCity.ActiveReports.JSViewer.export({
1119
+ * callback: ()=>console.log('test')
1120
+ * });
1121
+ * ```
1122
+ */
1123
+ callback: ExportCallback;
1124
+ /**
1125
+ * Export settings
1126
+ * @example Usage example:
1127
+ * ```javascript
1128
+ * // ESM usage
1129
+ * import {exportReport} from './jsViewer.min.js';
1130
+ * exportReport({
1131
+ * settings : {
1132
+ * EmbedFonts:'All',
1133
+ * Title:'MyInvoice'
1134
+ *}});
1135
+ * ```
1136
+ * @example Usage example:
1137
+ * ```javascript
1138
+ * // UMD usage
1139
+ * GrapeCity.ActiveReports.JSViewer.export({
1140
+ * settings : {
1141
+ * EmbedFonts:'All',
1142
+ * Title:'MyInvoice'
1143
+ *}});
1144
+ * ```
1145
+ */
1146
+ settings?: any;
1147
+ /**
1148
+ * @example Usage example:
1149
+ * ```javascript
1150
+ * // ESM usage
1151
+ * import {exportReport} from './jsViewer.min.js';
1152
+ * exportReport({
1153
+ * saveAsDialog: true
1154
+ * });
1155
+ * ```
1156
+ * @example Usage example:
1157
+ * ```javascript
1158
+ * // UMD usage
1159
+ * GrapeCity.ActiveReports.JSViewer.export({
1160
+ * saveAsDialog: true
1161
+ * });
1162
+ * ```
1163
+ */
1164
+ saveAsDialog?: boolean;
1165
+ }
1166
+ /** The following options can be set at run time while working with the JS Viewer. */
1167
+ interface PrintOptions {
1168
+ /**
1169
+ * The id of the report to be shown by the JS Viewer.
1170
+ * @example Usage example:
1171
+ * ```javascript
1172
+ * // ESM usage
1173
+ * import { printReport } from './jsViewer.min.js';
1174
+ * printReport({
1175
+ * reportID: 'AnnualReport.rdlx'
1176
+ * }):
1177
+ * ```
1178
+ * @example Usage example:
1179
+ * ```javascript
1180
+ * // UMD usage
1181
+ * GrapeCity.ActiveReports.JSViewer.print({
1182
+ * reportID: 'AnnualReport.rdlx'
1183
+ * }):
1184
+ * ```
1185
+ */
1186
+ reportID: string;
1187
+ /**
1188
+ * The array of the {name, value} pairs that describe the parameters values used to run the report.
1189
+ * @example Usage example:
1190
+ * ```javascript
1191
+ * // ESM usage
1192
+ * import { printReport } from './jsViewer.min.js';
1193
+ * printReport({
1194
+ * reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
1195
+ * }):
1196
+ * ```
1197
+ * @example Usage example:
1198
+ * ```javascript
1199
+ * // UMD usage
1200
+ * GrapeCity.ActiveReports.JSViewer.print({
1201
+ * reportParameters: [{ name: 'ReportParameter1', values: ['1']}]
1202
+ * }):
1203
+ * ```
1204
+ */
1205
+ reportParameters?: Parameter[];
1206
+ /**
1207
+ * The callback that is invoked when an error occurs in the process of displaying the report.
1208
+ * The default error panel does not appear if the callback returns true.
1209
+ * The error parameter is an object that has a message property which allows the users to customize
1210
+ * the error message and details property which allows to customize error details.
1211
+ * @example To hide the default error panel:
1212
+ * ```javascript
1213
+ * // ESM usage
1214
+ * import { printReport } from './jsViewer.min.js';
1215
+ * printReport({
1216
+ * error: (error) => {
1217
+ * if (error.message) {
1218
+ * // show error message.
1219
+ * alert("Internal error! Please ask administrator.");
1220
+ * // do not show default error message.
1221
+ * }
1222
+ * }
1223
+ * }):
1224
+ * ```
1225
+ * * @example To customize the error message:
1226
+ * ```javascript
1227
+ * // ESM usage
1228
+ * import { printReport } from './jsViewer.min.js';
1229
+ * printReport({
1230
+ * error: (error) => {
1231
+ * if (error.message) {
1232
+ * // show error message.
1233
+ * return {message = "Custom message", caption = "Custom caption"};
1234
+ * }
1235
+ * }
1236
+ * }):
1237
+ * ```
1238
+ * @example To hide the default error panel:
1239
+ * ```javascript
1240
+ * // UMD usage
1241
+ * GrapeCity.ActiveReports.JSViewer.print({
1242
+ * error: (error) => {
1243
+ * if (error.message) {
1244
+ * // show error message.
1245
+ * alert("Internal error! Please ask administrator.");
1246
+ * // do not show default error message.
1247
+ * }
1248
+ * }
1249
+ * }):
1250
+ * ```
1251
+ * * @example To customize the error message:
1252
+ * ```javascript
1253
+ * // UMD usage
1254
+ * GrapeCity.ActiveReports.JSViewer.print({
1255
+ * error: (error) => {
1256
+ * if (error.message) {
1257
+ * // show error message.
1258
+ * return {message = "Custom message", caption = "Custom caption"};
1259
+ * }
1260
+ * }
1261
+ * }):
1262
+ * ```
1263
+ */
1264
+ error: (error: ErrorInfo) => ErrorInfo;
1265
+ /**
1266
+ * Set up the settings to connect the Web API.
1267
+ * @example Usage example:
1268
+ * ```javascript
1269
+ * // ESM usage
1270
+ * import { printReport } from './jsViewer.min.js';
1271
+ * printReport({
1272
+ * reportService: {
1273
+ * url: 'http://example.com/api/reporting',
1274
+ * securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
1275
+ * }
1276
+ * }):
1277
+ * ```
1278
+ * @example Usage example:
1279
+ * ```javascript
1280
+ * // UMD usage
1281
+ * GrapeCity.ActiveReports.JSViewer.print({
1282
+ * reportService: {
1283
+ * url: 'http://example.com/api/reporting',
1284
+ * securityToken: '42A9CD80A4F3445A9BB60A221D042FCC',
1285
+ * }
1286
+ * }):
1287
+ * ```
1288
+ */
1289
+ reportService?: ReportServiceSettings;
1290
+ }
1291
+ interface JSViewer {
1292
+ /**
1293
+ * Apply slicers to the opened report.
1294
+ * @param slicers The array of the slicers values.
1295
+ * @example Usage example:
1296
+ * ```javascript
1297
+ * viewer.applySlicers([{name:'Year', type: 'Set', value: '2022' }])
1298
+ * ```
1299
+ */
1300
+ /**
1301
+ * Open report.
1302
+ * @param reportID The id of the report.
1303
+ * @param reportParameters The array of the parameters values.
1304
+ * @example Usage example:
1305
+ * ```javascript
1306
+ * // ESM usage
1307
+ * import { createViewer } from './jsViewer.min.js';
1308
+ * const viewer = createViewer({
1309
+ * element: '#root'
1310
+ * });
1311
+ * viewer.openReport('Invoice.rdlx')
1312
+ * ```
1313
+ * @example Usage example:
1314
+ * ```javascript
1315
+ * // UMD usage
1316
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1317
+ * element: '#root'
1318
+ * });
1319
+ * viewer.openReport('Invoice.rdlx')
1320
+ * ```
1321
+ */
1322
+ openReport: (reportID: string, reportParameters?: Parameter[]) => void;
1323
+ /**
1324
+ * Refreshes the report preview.
1325
+ * @example Usage example:
1326
+ * ```javascript
1327
+ * // ESM usage
1328
+ * import { createViewer } from './jsViewer.min.js';
1329
+ * const viewer = createViewer({
1330
+ * element: '#root'
1331
+ * });
1332
+ * viewer.refresh()
1333
+ * ```
1334
+ * @example Usage example:
1335
+ * ```javascript
1336
+ * // UMD usage
1337
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1338
+ * element: '#root'
1339
+ * });
1340
+ * viewer.refresh()
1341
+ * ```
1342
+ */
1343
+ refresh: () => void;
1344
+ /**
1345
+ * Prints the currently displayed report if any.
1346
+ * @example Usage example:
1347
+ * ```javascript
1348
+ * // ESM usage
1349
+ * import { createViewer } from './jsViewer.min.js';
1350
+ * const viewer = createViewer({
1351
+ * element: '#root',
1352
+ * reportID: 'AnnualReport.rdlx'
1353
+ * });
1354
+ * viewer.print()
1355
+ * ```
1356
+ * @example Usage example:
1357
+ * ```javascript
1358
+ * // UMD usage
1359
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1360
+ * element: '#root',
1361
+ * reportID: 'AnnualReport.rdlx'
1362
+ * });
1363
+ * viewer.print()
1364
+ * ```
1365
+ */
1366
+ print: () => void;
1367
+ /**
1368
+ * Makes the viewer to display the specific page. Page numeration starts with 1.
1369
+ * @param pageNumber The number of pages to go to.
1370
+ * @example Usage example:
1371
+ * ```javascript
1372
+ * // ESM usage
1373
+ * import { createViewer } from './jsViewer.min.js';
1374
+ * const viewer = createViewer({
1375
+ * element: '#root',
1376
+ * reportID: 'AnnualReport.rdlx'
1377
+ * });
1378
+ * viewer.goToPage(1)
1379
+ * ```
1380
+ * @example Usage example:
1381
+ * ```javascript
1382
+ * // UMD usage
1383
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1384
+ * element: '#root',
1385
+ * reportID: 'AnnualReport.rdlx'
1386
+ * });
1387
+ * viewer.goToPage(1)
1388
+ * ```
1389
+ */
1390
+ goToPage: (pageNumber: number) => void;
1391
+ /**
1392
+ * Makes the viewer to display the parent report of the drill-down report.
1393
+ * @example Usage example:
1394
+ * ```javascript
1395
+ * // ESM usage
1396
+ * import { createViewer } from './jsViewer.min.js';
1397
+ * const viewer = createViewer({
1398
+ * element: '#root',
1399
+ * reportID: 'AnnualReport.rdlx'
1400
+ * });
1401
+ * viewer.backToParent()
1402
+ * ```
1403
+ * @example Usage example:
1404
+ * ```javascript
1405
+ * // UMD usage
1406
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1407
+ * element: '#root',
1408
+ * reportID: 'AnnualReport.rdlx'
1409
+ * });
1410
+ * viewer.backToParent()
1411
+ * ```
1412
+ */
1413
+ backToParent: () => void;
1414
+ /**
1415
+ * Removes the viewer content from the element.
1416
+ * @example Usage example:
1417
+ * ```javascript
1418
+ * // ESM usage
1419
+ * import { createViewer } from './jsViewer.min.js';
1420
+ * const viewer = createViewer({
1421
+ * element: '#root'
1422
+ * });
1423
+ * viewer.destroy()
1424
+ * ```
1425
+ * @example Usage example:
1426
+ * ```javascript
1427
+ * // UMD usage
1428
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1429
+ * element: '#root'
1430
+ * });
1431
+ * viewer.destroy()
1432
+ * ```
1433
+ */
1434
+ destroy: () => void;
1435
+ /**
1436
+ * Exports the currently displayed report.
1437
+ * @param exportType Specifies export format.
1438
+ * @param callback Function that is invoked once the export result is available (its Url is passed in the callback).
1439
+ * @param saveAsDialog Indicates whether the save as dialog should be shown immediately once the export result is ready.
1440
+ * @param settings The export settings are available for RenderingExtensions.
1441
+ * @param isCancelRequested The function is periodically called with a check to cancel the export task.
1442
+ * @example Usage example:
1443
+ * ```javascript
1444
+ * // ESM usage
1445
+ * import { createViewer } from './jsViewer.min.js';
1446
+ * const viewer = createViewer({
1447
+ * element: '#root',
1448
+ * reportID: 'AnnualReport.rdlx',
1449
+ * availableExports: ['Pdf']
1450
+ * });
1451
+ * viewer.export('Pdf', downloadReport, true, { Title: '1997 Annual Report' })
1452
+ *
1453
+ * // function fetches the report from uri(callback function)
1454
+ * var downloadReport = function (uri) {
1455
+ * var newWin = null;
1456
+ * // open uri in new window
1457
+ * try {
1458
+ * newWin = window.open(uri);
1459
+ * } catch (e) { }
1460
+ * // if browser rejects opening new window, open uri in current window
1461
+ * if (!newWin) {
1462
+ * window.location = uri;
1463
+ * }
1464
+ * };
1465
+ * ```
1466
+ * @example Usage example:
1467
+ * ```javascript
1468
+ * // UMD usage
1469
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1470
+ * element: '#root',
1471
+ * reportID: 'AnnualReport.rdlx',
1472
+ * availableExports: ['Pdf']
1473
+ * });
1474
+ * viewer.export('Pdf', downloadReport, true, { Title: '1997 Annual Report' })
1475
+ *
1476
+ * // function fetches the report from uri(callback function)
1477
+ * var downloadReport = function (uri) {
1478
+ * var newWin = null;
1479
+ * // open uri in new window
1480
+ * try {
1481
+ * newWin = window.open(uri);
1482
+ * } catch (e) { }
1483
+ * // if browser rejects opening new window, open uri in current window
1484
+ * if (!newWin) {
1485
+ * window.location = uri;
1486
+ * }
1487
+ * };
1488
+ * ```
1489
+ */
1490
+ export: (exportType: ExportTypes, callback: ExportCallback, saveAsDialog: boolean, settings: any, isCancelRequested?: () => boolean | Promise<boolean>) => void;
1491
+ /**
1492
+ * Performs the search of a specific term with specific search options (match case, whole word)
1493
+ * and invokes the specific callback with the search result passed.
1494
+ * @param searchTerm String to find.
1495
+ * @param searchOptions The object optionally defines the search options.
1496
+ * @param callback The function to call after performing search.
1497
+ * @example Usage example:
1498
+ * ```javascript
1499
+ * // ESM usage
1500
+ * import { createViewer } from './jsViewer.min.js';
1501
+ * const viewer = createViewer({
1502
+ * element: '#root',
1503
+ * reportID: 'AnnualReport.rdlx'
1504
+ * });
1505
+ * viewer.search('a', { matchCase: true, wholePhrase: false }, (results) => console.log(results))
1506
+ * ```
1507
+ * @example Usage example:
1508
+ * ```javascript
1509
+ * // UMD usage
1510
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1511
+ * element: '#root',
1512
+ * reportID: 'AnnualReport.rdlx'
1513
+ * });
1514
+ * viewer.search('a', { matchCase: true, wholePhrase: false }, (results) => console.log(results))
1515
+ * ```
1516
+ */
1517
+ search: (searchTerm: string, searchOptions: SearchOptions, callback: (searchResult: any) => void) => void;
1518
+ /**
1519
+ * Obtains the report TOC.
1520
+ * @returns TOC tree.
1521
+ * @example Usage example:
1522
+ * ```javascript
1523
+ * // ESM usage
1524
+ * import { createViewer } from './jsViewer.min.js';
1525
+ * const viewer = createViewer({
1526
+ * element: '#root',
1527
+ * reportID: 'AnnualReport.rdlx'
1528
+ * });
1529
+ * console.log(viewer.getToc())
1530
+ * ```
1531
+ * @example Usage example:
1532
+ * ```javascript
1533
+ * // UMD usage
1534
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1535
+ * element: '#root',
1536
+ * reportID: 'AnnualReport.rdlx'
1537
+ * });
1538
+ * console.log(viewer.getToc())
1539
+ * ```
1540
+ */
1541
+ getToc: () => any;
1542
+ /**
1543
+ * Gets the page count of the currently displayed report.
1544
+ * @returns An integer representing page count.
1545
+ * @example Usage example:
1546
+ * ```javascript
1547
+ * // ESM usage
1548
+ * import { createViewer } from './jsViewer.min.js';
1549
+ * const viewer = createViewer({
1550
+ * element: '#root',
1551
+ * reportID: 'AnnualReport.rdlx'
1552
+ * });
1553
+ * console.log(viewer.pageCount())
1554
+ * ```
1555
+ * @example Usage example:
1556
+ * ```javascript
1557
+ * // UMD usage
1558
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1559
+ * element: '#root',
1560
+ * reportID: 'AnnualReport.rdlx'
1561
+ * });
1562
+ * console.log(viewer.pageCount())
1563
+ * ```
1564
+ */
1565
+ pageCount: () => number;
1566
+ /**
1567
+ * Gets the currently displayed page number.
1568
+ * @returns An integer representing currently displayed page number.
1569
+ * @example Usage example:
1570
+ * ```javascript
1571
+ * // ESM usage
1572
+ * import { createViewer } from './jsViewer.min.js';
1573
+ * const viewer = createViewer({
1574
+ * element: '#root',
1575
+ * reportID: 'AnnualReport.rdlx'
1576
+ * });
1577
+ * console.log(viewer.currentPage())
1578
+ * ```
1579
+ * @example Usage example:
1580
+ * ```javascript
1581
+ * // UMD usage
1582
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1583
+ * element: '#root',
1584
+ * reportID: 'AnnualReport.rdlx'
1585
+ * });
1586
+ * console.log(viewer.currentPage())
1587
+ * ```
1588
+ */
1589
+ currentPage: () => number;
1590
+ /**
1591
+ * The viewer's sidebar instance. The developer may use it to toggle the sidebar visibility.
1592
+ * @example Usage example:
1593
+ * ```javascript
1594
+ * // ESM usage
1595
+ * import { createViewer } from './jsViewer.min.js';
1596
+ * const viewer = createViewer({
1597
+ * element: '#root'
1598
+ * });
1599
+ * viewer.sidebar.toggle(false); // hide sidebar
1600
+ * ```
1601
+ * @example Usage example:
1602
+ * ```javascript
1603
+ * // UMD usage
1604
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1605
+ * element: '#root'
1606
+ * });
1607
+ * viewer.sidebar.toggle(false); // hide sidebar
1608
+ * ```
1609
+ */
1610
+ sidebar: Sidebar;
1611
+ /**
1612
+ * The viewer's toolbar instance. The developer may use it to add the custom elements or remove the existing ones.
1613
+ * @example Usage example:
1614
+ * ```javascript
1615
+ * // ESM usage
1616
+ * import { createViewer } from './jsViewer.min.js';
1617
+ * const viewer = createViewer({
1618
+ * element: '#root'
1619
+ * });
1620
+ * viewer.toolbar.toggle(false); // hide toolbar
1621
+ * ```
1622
+ * @example Usage example:
1623
+ * ```javascript
1624
+ * // UMD usage
1625
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1626
+ * element: '#root'
1627
+ * });
1628
+ * viewer.toolbar.toggle(false); // hide toolbar
1629
+ * ```
1630
+ */
1631
+ toolbar: Toolbar;
1632
+ /**
1633
+ * Gets or sets the viewer UI theme.
1634
+ * @example Usage example ESM:
1635
+ * ```javascript
1636
+ * import {createViewer, UIThemes} from './jsViewer.min.js';
1637
+ * const viewer = createViewer({
1638
+ * element: '#root',
1639
+ * });
1640
+ *
1641
+ * viewer.theme = UIThemes.defaultDark;
1642
+ * ```
1643
+ *
1644
+ * @example Usage example UMD:
1645
+ * ```javascript
1646
+ * var viewer = GrapeCity.ActiveReports.JSViewer.create({
1647
+ * element: '#root'
1648
+ * });
1649
+ * viewer.theme: GrapeCity.ActiveReports.JSViewer.Themes.defaultDark
1650
+ * ```
1651
+ */
1652
+ theme?: UITheme;
1653
+ }
1654
+
1655
+ /**
1656
+ * Do export of the report without showing a viewer.
1657
+ * @param params The export options.
1658
+ * @param isCancelRequested The function is periodically called with a check to cancel the export task.
1659
+ * @example Usage example:
1660
+ * ```javascript
1661
+ * // ESM usage
1662
+ * import {exportReport} from './jsViewer.min.js';
1663
+ * exportReport({
1664
+ * reportID:'Invoice.rdlx',
1665
+ * exportType: 'Pdf',
1666
+ * saveAsDialog: true,
1667
+ * settings : {
1668
+ * EmbedFonts:'All',
1669
+ * Title:'MyInvoice'
1670
+ * }});
1671
+ * ```
1672
+ */
1673
+ declare function exportReport(exportOptions: ExportOptions, isCancelRequested?: () => boolean): Promise<void>;
1674
+
1675
+ /**
1676
+ * Create and initialize JS Viewer.
1677
+ * @param params Initialization options.
1678
+ * @returns {JSViewer} JS Viewer instance.
1679
+ * @example Usage example:
1680
+ * ```javascript
1681
+ * // ESM usage
1682
+ * import { createViewer } from './jsViewer.min.js';
1683
+ * const viewer = createViewer({
1684
+ * element: '#root',
1685
+ * // other properties
1686
+ * });
1687
+ * ```
1688
+ */
1689
+ declare function createViewer(params: InitializationOptions): JSViewer;
1690
+
1691
+ /**
1692
+ * Print the report without showing a viewer.
1693
+ * @param params The print options.
1694
+ * @param isCancelRequested The function is periodically called with a check to cancel the export task.
1695
+ * @example Usage example:
1696
+ * ```javascript
1697
+ * // ESM usage
1698
+ * import { printReport } from './jsViewer.min.js';
1699
+ * printReport({
1700
+ * reportID: 'AnnualReport.rdlx'
1701
+ * });
1702
+ * ```
1703
+ */
1704
+ declare function printReport(printOptions: PrintOptions, isCancelRequested?: () => boolean): Promise<void>;
1705
+
1706
+ export { AnimationOptions, Color, DefaultExportSettings, ErrorInfo, ErrorSeverity, ExportCallback, ExportOptions, ExportTypes, HoverChartAnimationOptions, HoverTableAnimationOptions, InitialZoomMode, InitializationOptions, JSViewer, LoadChartAnimationOptions, PageViewOptions, PanelsLocation, Parameter, ParameterDescriptor, ParametersPanelSettings, Percentage, PrintOptions, RenderFormat, RenderMode, ReportInfo, ReportServiceSettings, ReportType, SearchOptions, Sidebar, SizeType, Toolbar, ToolbarButtons, UITheme, UIThemes, ViewMode, ViewerType, createViewer, exportReport, printReport };