@progress/telerik-react-report-viewer 29.26.304 → 29.26.402
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.
- package/README.md +1 -1
- package/dist/cjs/reportViewer.js +18 -7
- package/dist/cjs/telerik-report-viewer.js +346 -336
- package/dist/dependencies/telerikReportViewer.d.ts +85 -83
- package/dist/dependencies/telerikReportViewer.js +275 -67
- package/dist/dependencies/telerikReportViewerTemplate.html +3 -3
- package/dist/es/reportViewer.js +14 -3
- package/dist/es/telerik-report-viewer.js +346 -336
- package/package.json +2 -2
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
1
|
import '../dependencies/initExtDeps';
|
|
7
2
|
import React from 'react';
|
|
8
3
|
import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
@@ -22,8 +17,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
22
17
|
* - Default: "LIST_VIEW"
|
|
23
18
|
*
|
|
24
19
|
* @example
|
|
25
|
-
* //
|
|
26
|
-
*
|
|
20
|
+
* // Specify editor types for report parameters
|
|
27
21
|
* <TelerikReportViewer
|
|
28
22
|
* serviceUrl="api/reports/"
|
|
29
23
|
* reportSource={{ report: "Dashboard.trdp" }}
|
|
@@ -54,19 +48,19 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
54
48
|
|
|
55
49
|
/**
|
|
56
50
|
* Configuration for connecting to a Telerik Report Server instance.
|
|
57
|
-
*
|
|
51
|
+
*
|
|
58
52
|
* The authentication method depends on the Report Server version:
|
|
59
53
|
* - Report Server for .NET: Supports Token authentication (getPersonalAccessToken) or username/password authentication. The token can be from any user, including the Guest user.
|
|
60
54
|
* - Report Server for .NET Framework 4.6.2: Supports username/password authentication or Guest account (url only, if Guest is enabled on the server).
|
|
61
|
-
*
|
|
55
|
+
*
|
|
62
56
|
* @typedef {Object} ReportServer
|
|
63
|
-
* @property {string} url - The URL
|
|
64
|
-
* @property {function} [getPersonalAccessToken] - A callback
|
|
65
|
-
* @property {string} [username] - A registered username
|
|
66
|
-
* @property {string} [password] - The password for the provided username.
|
|
57
|
+
* @property {string} url - The URL of the Telerik Report Server instance.
|
|
58
|
+
* @property {function} [getPersonalAccessToken] - A callback that returns a Promise resolving to a Personal Access Token for authentication. Recommended for Report Server for .NET. The token can be from any user account, including the Guest user.
|
|
59
|
+
* @property {string} [username] - A registered username for Report Server authentication. Supported by both Report Server for .NET and Report Server for .NET Framework. When omitted with Report Server for .NET Framework and Guest enabled, the built-in Guest account is used.
|
|
60
|
+
* @property {string} [password] - The password for the provided username. Can be omitted only when connecting with the Guest account to Report Server for .NET Framework.
|
|
67
61
|
*
|
|
68
62
|
* @example <propertyName>getPersonalAccessToken</propertyName>
|
|
69
|
-
* //
|
|
63
|
+
* // Report Server for .NET - Token authentication (recommended)
|
|
70
64
|
* <TelerikReportViewer
|
|
71
65
|
* reportServer={{
|
|
72
66
|
* url: "https://my-report-server-net/",
|
|
@@ -78,7 +72,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
78
72
|
* />
|
|
79
73
|
*
|
|
80
74
|
* @example <propertyName>getPersonalAccessToken</propertyName>
|
|
81
|
-
* //
|
|
75
|
+
* // Report Server for .NET - Token authentication with a secure endpoint
|
|
82
76
|
* <TelerikReportViewer
|
|
83
77
|
* reportServer={{
|
|
84
78
|
* url: "https://my-report-server-net/",
|
|
@@ -91,7 +85,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
91
85
|
* />
|
|
92
86
|
*
|
|
93
87
|
* @example <propertyName>getPersonalAccessToken</propertyName>
|
|
94
|
-
* //
|
|
88
|
+
* // Report Server for .NET - Token authentication with Guest user token
|
|
95
89
|
* <TelerikReportViewer
|
|
96
90
|
* reportServer={{
|
|
97
91
|
* url: "https://my-report-server-net/",
|
|
@@ -103,7 +97,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
103
97
|
* />
|
|
104
98
|
*
|
|
105
99
|
* @example <propertyName>username</propertyName>
|
|
106
|
-
* //
|
|
100
|
+
* // Report Server for .NET - Username/password authentication
|
|
107
101
|
* <TelerikReportViewer
|
|
108
102
|
* reportServer={{
|
|
109
103
|
* url: "https://my-report-server-net/",
|
|
@@ -114,7 +108,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
114
108
|
* />
|
|
115
109
|
*
|
|
116
110
|
* @example <propertyName>username</propertyName>
|
|
117
|
-
* //
|
|
111
|
+
* // Report Server for .NET Framework - Username/password authentication
|
|
118
112
|
* <TelerikReportViewer
|
|
119
113
|
* reportServer={{
|
|
120
114
|
* url: "https://my-report-server-framework/",
|
|
@@ -125,7 +119,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
125
119
|
* />
|
|
126
120
|
*
|
|
127
121
|
* @example <propertyName>url</propertyName>
|
|
128
|
-
* //
|
|
122
|
+
* // Report Server for .NET Framework - Guest account (requires Guest enabled on server)
|
|
129
123
|
* <TelerikReportViewer
|
|
130
124
|
* reportServer={{
|
|
131
125
|
* url: "https://my-report-server-framework/"
|
|
@@ -134,7 +128,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
134
128
|
* />
|
|
135
129
|
*
|
|
136
130
|
* @example <propertyName>reportServer</propertyName>
|
|
137
|
-
* //
|
|
131
|
+
* // Complete initialization with Report Server for .NET using Token authentication
|
|
138
132
|
* <TelerikReportViewer
|
|
139
133
|
* reportServer={{
|
|
140
134
|
* url: "https://my-report-server-net/",
|
|
@@ -154,19 +148,19 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
154
148
|
/**
|
|
155
149
|
* Configuration object that identifies the report to be displayed and provides initial parameter values.
|
|
156
150
|
* @typedef {Object} ReportSource
|
|
157
|
-
* @property {string} [report] - A string
|
|
158
|
-
* @property {ReportParameters} [parameters] -
|
|
151
|
+
* @property {string} [report] - A string identifying the report to display. This can be a path to a report definition file (e.g., 'Dashboard.trdp' or 'Dashboard.trdx'), a type name, or a custom identifier resolved by the server-side report source resolver. For Report Server, use the format '{Category}/{ReportName}'.
|
|
152
|
+
* @property {ReportParameters} [parameters] - An object whose keys are report parameter names and values are the corresponding parameter values.
|
|
159
153
|
*
|
|
160
154
|
* @example <propertyName>report</propertyName>
|
|
161
|
-
* //
|
|
155
|
+
* // Minimal report source with only the report file name
|
|
162
156
|
* const reportSource = {
|
|
163
|
-
* report: "MyReport"
|
|
157
|
+
* report: "MyReport.trdp"
|
|
164
158
|
* };
|
|
165
159
|
*
|
|
166
160
|
* @example <propertyName>parameters</propertyName>
|
|
167
|
-
* //
|
|
161
|
+
* // Report source with parameters
|
|
168
162
|
* const reportSource = {
|
|
169
|
-
* report: "SalesReport",
|
|
163
|
+
* report: "SalesReport.trdp",
|
|
170
164
|
* parameters: {
|
|
171
165
|
* StartDate: "2024-01-01",
|
|
172
166
|
* EndDate: "2024-12-31",
|
|
@@ -175,13 +169,13 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
175
169
|
* };
|
|
176
170
|
*
|
|
177
171
|
* @example <propertyName>report</propertyName>
|
|
178
|
-
* //
|
|
172
|
+
* // Report Server format
|
|
179
173
|
* const reportSource = {
|
|
180
174
|
* report: "Finance/MonthlyReport"
|
|
181
175
|
* };
|
|
182
176
|
*
|
|
183
177
|
* @example
|
|
184
|
-
* //
|
|
178
|
+
* // Using ReportSource with the React Report Viewer
|
|
185
179
|
* <TelerikReportViewer
|
|
186
180
|
* serviceUrl="api/reports/"
|
|
187
181
|
* reportSource={{
|
|
@@ -217,8 +211,8 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
217
211
|
* @property {string} [to] - E-mail address used for the MailMessage TO value.
|
|
218
212
|
* @property {string} [cc] - E-mail address used for the MailMessage Carbon Copy value.
|
|
219
213
|
* @property {string} [subject] - A string used for the MailMessage Subject value.
|
|
220
|
-
* @property {string} [body] -
|
|
221
|
-
* @property {string} [format] - The preselected report
|
|
214
|
+
* @property {string} [body] - Text content for the email body.
|
|
215
|
+
* @property {string} [format] - The preselected document format for the report attachment (e.g., 'PDF', 'XLSX').
|
|
222
216
|
*
|
|
223
217
|
* @example
|
|
224
218
|
* // Enable Send Email with default values and PDF as the default format
|
|
@@ -250,63 +244,79 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
250
244
|
|
|
251
245
|
/**
|
|
252
246
|
* Represents the API of a parameter editor instance returned by createEditor.
|
|
247
|
+
*
|
|
248
|
+
* Implementations must provide `beginEdit`, `addAccessibility`, and `setAccessibilityErrorState`.
|
|
249
|
+
* The viewer calls `addAccessibility` / `setAccessibilityErrorState` when `enableAccessibility` is true.
|
|
250
|
+
* Optional members like `clearPendingChange` and `destroy` are lifecycle hooks for editors
|
|
251
|
+
* that manage external widgets or pending async updates.
|
|
253
252
|
* @typedef {Object} ParameterEditorInstance
|
|
254
253
|
* @property {function(Object):void} beginEdit - Creates the editor UI and populates it with the parameter settings.
|
|
255
|
-
* @property {function(Object):void} addAccessibility - Adds accessibility to the parameter editor and populates its string resources.
|
|
256
|
-
* @property {function(Object):void} setAccessibilityErrorState - Sets the error state of the parameter editor's accessibility functionality and its error attributes.
|
|
257
|
-
* @
|
|
258
|
-
* @property {function():void}
|
|
259
|
-
* @property {function():void} [
|
|
254
|
+
* @property {function(Object):void} addAccessibility - Adds accessibility to the parameter editor and populates its string resources. Called by the viewer when `enableAccessibility` is true.
|
|
255
|
+
* @property {function(Object):void} setAccessibilityErrorState - Sets the error state of the parameter editor's accessibility functionality and its error attributes. Called by the viewer when `enableAccessibility` is true and the user changes value.
|
|
256
|
+
* @internal
|
|
257
|
+
* @property {function(boolean):void} enable - Enables or disables the parameter editor (e.g., when the "use default value" checkbox is toggled).
|
|
258
|
+
* @property {function():void} [clearPendingChange] - Invoked when parameter changes.
|
|
259
|
+
* @property {function():void} [destroy] - Invoked to destroy the parameter editor.
|
|
260
260
|
*/
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
|
-
* Describes a parameter editor for the Telerik Report Viewer
|
|
263
|
+
* Describes a parameter editor for the Telerik Report Viewer parameters area.
|
|
264
264
|
* @typedef {Object} ParameterEditor
|
|
265
265
|
* @property {function(Object): boolean} match - Determines if the editor is suitable for the parameter.
|
|
266
|
-
* @property {function(HTMLElement, Object): ParameterEditorInstance} createEditor - Creates the editor UI.
|
|
266
|
+
* @property {function(HTMLElement, Object): ParameterEditorInstance} createEditor - Creates the editor UI and returns an editor instance.
|
|
267
267
|
* @example
|
|
268
|
-
* //
|
|
269
|
-
*
|
|
270
|
-
* // Use parameter properties to determine if this editor should be used
|
|
268
|
+
* // Custom match function for single-select parameters
|
|
269
|
+
* function match(parameter) {
|
|
271
270
|
* return Boolean(parameter.availableValues) && !parameter.multivalue;
|
|
272
|
-
* }
|
|
271
|
+
* }
|
|
273
272
|
*
|
|
274
273
|
* @example
|
|
275
|
-
* //
|
|
274
|
+
* // Custom createEditor function using Kendo DateTimePicker
|
|
276
275
|
* function match(parameter) {
|
|
277
276
|
* return parameter.type === "System.DateTime";
|
|
278
277
|
* }
|
|
279
278
|
*
|
|
280
279
|
* function createEditor(placeholder, options) {
|
|
281
|
-
*
|
|
282
|
-
* parameter
|
|
283
|
-
* valueChangedCallback = options.parameterChanged
|
|
284
|
-
*
|
|
280
|
+
* const container = $(placeholder).html('<input type="datetime"/>');
|
|
281
|
+
* let parameter;
|
|
282
|
+
* const valueChangedCallback = options.parameterChanged;
|
|
283
|
+
* let picker;
|
|
284
|
+
*
|
|
285
285
|
* function onChange() {
|
|
286
|
-
*
|
|
286
|
+
* const val = picker.value();
|
|
287
287
|
* valueChangedCallback(parameter, val);
|
|
288
288
|
* }
|
|
289
|
+
*
|
|
289
290
|
* return {
|
|
290
291
|
* beginEdit: function (param) {
|
|
291
292
|
* parameter = param;
|
|
292
|
-
* $(
|
|
293
|
+
* $(container).find("input").kendoDateTimePicker({
|
|
293
294
|
* dataTextField: "name",
|
|
294
295
|
* dataValueField: "value",
|
|
295
296
|
* value: parameter.value,
|
|
296
297
|
* dataSource: parameter.availableValues,
|
|
297
298
|
* change: onChange
|
|
298
299
|
* });
|
|
299
|
-
*
|
|
300
|
+
* picker = $(container).find("input").data("kendoDateTimePicker");
|
|
301
|
+
* },
|
|
302
|
+
*
|
|
303
|
+
* addAccessibility: function (accessibilityOptions) {
|
|
304
|
+
* // Apply ARIA attributes, labels, etc. to the editor input.
|
|
305
|
+
* },
|
|
306
|
+
*
|
|
307
|
+
* setAccessibilityErrorState: function (hasError) {
|
|
308
|
+
* // Update ARIA error attributes on the editor input.
|
|
300
309
|
* }
|
|
301
310
|
* };
|
|
302
311
|
* }
|
|
303
312
|
*
|
|
304
313
|
* @example
|
|
305
|
-
* //
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* }
|
|
314
|
+
* // Registering a custom parameter editor
|
|
315
|
+
* <TelerikReportViewer
|
|
316
|
+
* serviceUrl="api/reports/"
|
|
317
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
318
|
+
* parameterEditors={[{ match, createEditor }]}
|
|
319
|
+
* />
|
|
310
320
|
*
|
|
311
321
|
*/
|
|
312
322
|
|
|
@@ -354,7 +364,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
354
364
|
* reportSource={{ report: "Finance/Dashboard" }}
|
|
355
365
|
* />
|
|
356
366
|
*
|
|
357
|
-
* @property {string} [templateUrl] - Sets the address of the
|
|
367
|
+
* @property {string} [templateUrl] - Sets the address of the HTML page that contains the viewer templates. If omitted, the default template will be downloaded from the REST service.
|
|
358
368
|
* @example <propertyName>templateUrl</propertyName>
|
|
359
369
|
* // Use a custom template
|
|
360
370
|
* <TelerikReportViewer
|
|
@@ -466,45 +476,90 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
466
476
|
* }}
|
|
467
477
|
* />
|
|
468
478
|
*
|
|
469
|
-
* @property {ParameterEditor} [parameterEditors] - Allows the user to define custom editors for the report parameters.
|
|
479
|
+
* @property {ParameterEditor[]} [parameterEditors] - Allows the user to define custom editors for the report parameters.
|
|
470
480
|
* @example <propertyName>parameterEditors</propertyName>
|
|
471
481
|
* // Register custom parameter editors
|
|
472
482
|
* const customEditors = [{
|
|
473
483
|
* match: function(param) { return param.name === "MyParam"; },
|
|
474
|
-
* createEditor: function(placeholder, options) {
|
|
484
|
+
* createEditor: function(placeholder, options) {
|
|
485
|
+
* return {
|
|
486
|
+
* beginEdit: function(param) {
|
|
487
|
+
* // Create and initialize the editor UI inside placeholder.
|
|
488
|
+
* },
|
|
489
|
+
* addAccessibility: function(accessibilityOptions) {
|
|
490
|
+
* // Apply ARIA attributes and accessibility strings.
|
|
491
|
+
* },
|
|
492
|
+
* setAccessibilityErrorState: function(hasError) {
|
|
493
|
+
* // Update accessibility error state on the editor.
|
|
494
|
+
* }
|
|
495
|
+
* };
|
|
496
|
+
* }
|
|
475
497
|
* }];
|
|
476
|
-
*
|
|
498
|
+
*
|
|
499
|
+
* <TelerikReportViewer
|
|
500
|
+
* serviceUrl="api/reports/"
|
|
501
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
502
|
+
* parameterEditors={customEditors}
|
|
503
|
+
* />
|
|
477
504
|
*
|
|
478
505
|
* @property {string} [authenticationToken] - If provided, a Bearer token will be set in the Authorization header for every request to the REST service.
|
|
479
506
|
* @example <propertyName>authenticationToken</propertyName>
|
|
480
|
-
* // Set authentication token
|
|
481
|
-
*
|
|
482
|
-
*
|
|
507
|
+
* // Set a Bearer authentication token for REST service requests
|
|
508
|
+
* <TelerikReportViewer
|
|
509
|
+
* serviceUrl="api/reports/"
|
|
510
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
511
|
+
* authenticationToken="YOUR_AUTH_TOKEN"
|
|
512
|
+
* />
|
|
483
513
|
*
|
|
484
514
|
* @property {string} [printMode] - Specifies how the viewer should print reports. Available values: "AUTO_SELECT" (automatically decide based on browser), "FORCE_PDF_FILE" (download as PDF file), "FORCE_PDF_PLUGIN" (use PDF plug-in). Default value is "AUTO_SELECT".
|
|
485
515
|
* @example <propertyName>printMode</propertyName>
|
|
486
|
-
* // Force PDF file for printing
|
|
487
|
-
*
|
|
516
|
+
* // Force PDF file download for printing
|
|
517
|
+
* <TelerikReportViewer
|
|
518
|
+
* serviceUrl="api/reports/"
|
|
519
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
520
|
+
* printMode="FORCE_PDF_FILE"
|
|
521
|
+
* />
|
|
488
522
|
*
|
|
489
|
-
* @property {string} [selector] - A selector
|
|
523
|
+
* @property {string} [selector] - A CSS selector that identifies the viewer's container element. Required when using external command buttons via data-attributes. External buttons must set their `data-target-report-viewer` attribute to this same value so the viewer can resolve which instance to command and apply `disabledButtonClass` / `checkedButtonClass` toggling.
|
|
490
524
|
* @example <propertyName>selector</propertyName>
|
|
491
|
-
* //
|
|
492
|
-
*
|
|
525
|
+
* // The selector must match the viewer's own container id (same value used in data-target-report-viewer on external buttons)
|
|
526
|
+
* <TelerikReportViewer
|
|
527
|
+
* id="rv1"
|
|
528
|
+
* serviceUrl="api/reports/"
|
|
529
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
530
|
+
* selector="#rv1"
|
|
531
|
+
* disabledButtonClass="btn-disabled"
|
|
532
|
+
* checkedButtonClass="btn-checked"
|
|
533
|
+
* />
|
|
493
534
|
*
|
|
494
|
-
*
|
|
535
|
+
* // External buttons reference the same selector in data-target-report-viewer:
|
|
536
|
+
* // <button data-command="telerik_ReportViewer_goToNextPage" data-target-report-viewer="#rv1">Next</button>
|
|
537
|
+
*
|
|
538
|
+
* @property {string} [disabledButtonClass] - A CSS class added to external command buttons (bound via data-attributes) when the command is in a disabled state.
|
|
495
539
|
* @example <propertyName>disabledButtonClass</propertyName>
|
|
496
|
-
* //
|
|
497
|
-
*
|
|
540
|
+
* // Apply custom styling to disabled command buttons
|
|
541
|
+
* <TelerikReportViewer
|
|
542
|
+
* id="rv1"
|
|
543
|
+
* serviceUrl="api/reports/"
|
|
544
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
545
|
+
* selector="#rv1"
|
|
546
|
+
* disabledButtonClass="btn-disabled"
|
|
547
|
+
* />
|
|
498
548
|
*
|
|
499
|
-
* @property {string} [checkedButtonClass] - A class
|
|
549
|
+
* @property {string} [checkedButtonClass] - A CSS class added to external command buttons (bound via data-attributes) when the command is in a checked state.
|
|
500
550
|
* @example <propertyName>checkedButtonClass</propertyName>
|
|
501
|
-
* //
|
|
502
|
-
*
|
|
551
|
+
* // Apply custom styling to checked/active command buttons
|
|
552
|
+
* <TelerikReportViewer
|
|
553
|
+
* id="rv1"
|
|
554
|
+
* serviceUrl="api/reports/"
|
|
555
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
556
|
+
* selector="#rv1"
|
|
557
|
+
* checkedButtonClass="btn-active"
|
|
558
|
+
* />
|
|
503
559
|
*
|
|
504
560
|
* @property {boolean} [enableAccessibility] - Determines whether the viewer should provide support for accessibility features. Default value is false.
|
|
505
561
|
* @example <propertyName>enableAccessibility</propertyName>
|
|
506
562
|
* // Enable accessibility features
|
|
507
|
-
* // Use with component: enableAccessibility={true}
|
|
508
563
|
* <TelerikReportViewer
|
|
509
564
|
* serviceUrl="api/reports/"
|
|
510
565
|
* reportSource={{ report: "Dashboard.trdp" }}
|
|
@@ -565,7 +620,7 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
565
620
|
* initialPageAreaImageUrl="/images/reportBackground.png"
|
|
566
621
|
* />
|
|
567
622
|
*
|
|
568
|
-
* @property {boolean} [keepClientAlive] - Determines whether the client
|
|
623
|
+
* @property {boolean} [keepClientAlive] - Determines whether the viewer sends periodic keep-alive requests to the server to prevent the client session from expiring. Default value is true.
|
|
569
624
|
* @example <propertyName>keepClientAlive</propertyName>
|
|
570
625
|
* // Keep client alive
|
|
571
626
|
* <TelerikReportViewer
|
|
@@ -587,6 +642,19 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
587
642
|
* }}
|
|
588
643
|
* />
|
|
589
644
|
*
|
|
645
|
+
* @property {Object} [localizationResources] - An object containing all or a subset of the viewer's localization resources in a chosen language.
|
|
646
|
+
* @example <propertyName>localizationResources</propertyName>
|
|
647
|
+
* // Set localization resources
|
|
648
|
+
* <TelerikReportViewer
|
|
649
|
+
* serviceUrl="api/reports/"
|
|
650
|
+
* reportSource={{ report: "Dashboard.trdp" }}
|
|
651
|
+
* localizationResources={{
|
|
652
|
+
* loadingFormats: "Loading...",
|
|
653
|
+
* loadingReport: "Loading report...",
|
|
654
|
+
* loadingParameters: "Loading parameters...",
|
|
655
|
+
* }}
|
|
656
|
+
* />
|
|
657
|
+
*
|
|
590
658
|
* @property {function} [ready] - A callback function that is called when the viewer content has been loaded from the template and is ready to display reports or perform any other operations.
|
|
591
659
|
* @example <propertyName>ready</propertyName>
|
|
592
660
|
* // Ready callback
|
|
@@ -648,11 +716,9 @@ import { ReportViewer } from '../dependencies/telerikReportViewer.js';
|
|
|
648
716
|
* serviceUrl="api/reports/"
|
|
649
717
|
* reportSource={{ report: "Dashboard.trdp" }}
|
|
650
718
|
* renderingBegin={(e, args) => {
|
|
651
|
-
* //
|
|
652
|
-
*
|
|
653
|
-
* args.deviceInfo["
|
|
654
|
-
* args.deviceInfo["CurrentUICulture"] = culture;
|
|
655
|
-
* console.log("About to render the report.");
|
|
719
|
+
* // Use deviceInfo to set a specific culture for rendering
|
|
720
|
+
* args.deviceInfo["CurrentCulture"] = "de-DE";
|
|
721
|
+
* args.deviceInfo["CurrentUICulture"] = "de-DE";
|
|
656
722
|
* }}
|
|
657
723
|
* />
|
|
658
724
|
*
|
|
@@ -859,7 +925,9 @@ export class TelerikReportViewer extends React.Component {
|
|
|
859
925
|
documentMapVisible: this.props.documentMapVisible,
|
|
860
926
|
documentMapAreaPosition: this.props.documentMapAreaPosition,
|
|
861
927
|
parametersAreaPosition: this.props.parametersAreaPosition,
|
|
862
|
-
keepClientAlive: keepClientAlive
|
|
928
|
+
keepClientAlive: keepClientAlive,
|
|
929
|
+
localizationResources: this.props.localizationResources,
|
|
930
|
+
wrapper: "react"
|
|
863
931
|
});
|
|
864
932
|
this.commands = this.viewerObject.commands;
|
|
865
933
|
}
|
|
@@ -869,7 +937,9 @@ export class TelerikReportViewer extends React.Component {
|
|
|
869
937
|
render() {
|
|
870
938
|
return /*#__PURE__*/React.createElement("div", {
|
|
871
939
|
id: this.state.reportViewerID,
|
|
872
|
-
style:
|
|
940
|
+
style: {
|
|
941
|
+
...this.props.viewerContainerStyle
|
|
942
|
+
},
|
|
873
943
|
ref: el => this.el = el
|
|
874
944
|
});
|
|
875
945
|
}
|
|
@@ -906,7 +976,7 @@ export class TelerikReportViewer extends React.Component {
|
|
|
906
976
|
/**
|
|
907
977
|
* Sets the report source - report and parameters. Automatically reloads the report (if any) into the view.
|
|
908
978
|
* @function
|
|
909
|
-
* @param {{report: string, parameters: Object}}
|
|
979
|
+
* @param {{report: string, parameters: Object}} reportSource - The report source object to set. Object with properties: report (string) and parameters (JSON).
|
|
910
980
|
* @returns {TelerikReportViewer} The current ReportViewer object.
|
|
911
981
|
* @example
|
|
912
982
|
* // Set a new report source
|
|
@@ -915,8 +985,8 @@ export class TelerikReportViewer extends React.Component {
|
|
|
915
985
|
* parameters: { StartDate: "2024-01-01", EndDate: "2024-12-31" }
|
|
916
986
|
* });
|
|
917
987
|
*/
|
|
918
|
-
setReportSource(
|
|
919
|
-
return this.viewerObject.reportSource(
|
|
988
|
+
setReportSource(reportSource) {
|
|
989
|
+
return this.viewerObject.reportSource(reportSource);
|
|
920
990
|
}
|
|
921
991
|
|
|
922
992
|
/**
|
|
@@ -933,16 +1003,16 @@ export class TelerikReportViewer extends React.Component {
|
|
|
933
1003
|
}
|
|
934
1004
|
|
|
935
1005
|
/**
|
|
936
|
-
* Sets the view mode and automatically reloads the current report
|
|
1006
|
+
* Sets the view mode and automatically reloads the current report into the new view.
|
|
937
1007
|
* @function
|
|
938
|
-
* @param {string}
|
|
1008
|
+
* @param {string} viewMode - The view mode to set ("INTERACTIVE" or "PRINT_PREVIEW").
|
|
939
1009
|
* @returns {TelerikReportViewer} The current ReportViewer object.
|
|
940
1010
|
* @example
|
|
941
1011
|
* // Set view mode to print preview
|
|
942
1012
|
* reportViewerRef.current.setViewMode("PRINT_PREVIEW");
|
|
943
1013
|
*/
|
|
944
|
-
setViewMode(
|
|
945
|
-
return this.viewerObject.viewMode(
|
|
1014
|
+
setViewMode(viewMode) {
|
|
1015
|
+
return this.viewerObject.viewMode(viewMode);
|
|
946
1016
|
}
|
|
947
1017
|
|
|
948
1018
|
/**
|
|
@@ -1011,9 +1081,9 @@ export class TelerikReportViewer extends React.Component {
|
|
|
1011
1081
|
}
|
|
1012
1082
|
|
|
1013
1083
|
/**
|
|
1014
|
-
* Gets the shortcut keys used when the report viewer is in accessible mode (enableAccessibility=true).
|
|
1084
|
+
* Gets the shortcut keys used when the report viewer is in accessible mode (enableAccessibility={true}).
|
|
1015
1085
|
* @function
|
|
1016
|
-
* @returns {Object} The current accessibility key map.
|
|
1086
|
+
* @returns {Object|undefined} The current accessibility key map, or undefined if accessibility is not enabled.
|
|
1017
1087
|
* @example
|
|
1018
1088
|
* // Get accessibility key map
|
|
1019
1089
|
* const keyMap = reportViewerRef.current.getAccessibilityKeyMap();
|
|
@@ -1026,7 +1096,7 @@ export class TelerikReportViewer extends React.Component {
|
|
|
1026
1096
|
}
|
|
1027
1097
|
|
|
1028
1098
|
/**
|
|
1029
|
-
* Sets the shortcut keys used when the report viewer is in accessible mode.
|
|
1099
|
+
* Sets the shortcut keys used when the report viewer is in accessible mode. Set the new key map after the report rendering is complete, because the accessibility routines require the report viewer template to be loaded.
|
|
1030
1100
|
* @function
|
|
1031
1101
|
* @param {Object} keyMap - The key map object with keyboard shortcuts.
|
|
1032
1102
|
* @returns {TelerikReportViewer} The current ReportViewer object.
|
|
@@ -1110,14 +1180,14 @@ export class TelerikReportViewer extends React.Component {
|
|
|
1110
1180
|
/**
|
|
1111
1181
|
* Sets the page mode of the viewer.
|
|
1112
1182
|
* @function
|
|
1113
|
-
* @param {string}
|
|
1114
|
-
* @returns {
|
|
1183
|
+
* @param {string} pageMode - The page mode to set ("SINGLE_PAGE" or "CONTINUOUS_SCROLL").
|
|
1184
|
+
* @returns {TelerikReportViewer} The current ReportViewer object.
|
|
1115
1185
|
* @example
|
|
1116
1186
|
* // Set page mode to single page
|
|
1117
1187
|
* reportViewerRef.current.setPageMode("SINGLE_PAGE");
|
|
1118
1188
|
*/
|
|
1119
|
-
setPageMode(
|
|
1120
|
-
return this.viewerObject.pageMode(
|
|
1189
|
+
setPageMode(pageMode) {
|
|
1190
|
+
return this.viewerObject.pageMode(pageMode);
|
|
1121
1191
|
}
|
|
1122
1192
|
|
|
1123
1193
|
/**
|
|
@@ -1170,7 +1240,7 @@ export default TelerikReportViewer;
|
|
|
1170
1240
|
* - checked(): Returns a boolean indicating if the command is in a checked state (for toggle commands).
|
|
1171
1241
|
*
|
|
1172
1242
|
* @typedef {Object} ReportViewerCommand
|
|
1173
|
-
* @property {Function} exec - Executes the command. Some commands accept parameters (see
|
|
1243
|
+
* @property {Function} exec - Executes the command. Some commands accept parameters (see each command's exec example).
|
|
1174
1244
|
* @property {Function} enabled - Returns whether the command is currently enabled.
|
|
1175
1245
|
* @property {Function} checked - Returns whether the command is in a checked state (for toggle commands).
|
|
1176
1246
|
*/
|
|
@@ -1179,357 +1249,297 @@ export default TelerikReportViewer;
|
|
|
1179
1249
|
* Collection of all available commands for the report viewer. Each property is a command name mapped to a {@link ReportViewerCommand} instance.
|
|
1180
1250
|
*
|
|
1181
1251
|
* @typedef {Object} ReportViewerCommands
|
|
1182
|
-
|
|
1183
1252
|
* @property {ReportViewerCommand} historyBack - Goes back to the previously rendered report from history.
|
|
1184
1253
|
* @example <propertyName>historyBack</propertyName>
|
|
1185
|
-
* //
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
* <>
|
|
1189
|
-
* <TelerikReportViewer />
|
|
1190
|
-
* <button onClick={() => viewer.commands.historyBack.exec()}>Back</button>
|
|
1191
|
-
* </>
|
|
1192
|
-
* );
|
|
1254
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1255
|
+
* // Navigate back to the previous report in history
|
|
1256
|
+
* reportViewerRef.current.commands.historyBack.exec();
|
|
1193
1257
|
* @example <propertyName>historyBack</propertyName>
|
|
1258
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1194
1259
|
* // Check if the command is enabled
|
|
1195
|
-
* const isEnabled =
|
|
1260
|
+
* const isEnabled = reportViewerRef.current.commands.historyBack.enabled();
|
|
1196
1261
|
* @example <propertyName>historyBack</propertyName>
|
|
1262
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1197
1263
|
* // Check if the command is checked
|
|
1198
|
-
* const isChecked =
|
|
1264
|
+
* const isChecked = reportViewerRef.current.commands.historyBack.checked();
|
|
1265
|
+
*
|
|
1199
1266
|
* @property {ReportViewerCommand} historyForward - Goes forward to the next rendered report from history.
|
|
1200
1267
|
* @example <propertyName>historyForward</propertyName>
|
|
1201
|
-
* //
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1204
|
-
* <>
|
|
1205
|
-
* <TelerikReportViewer />
|
|
1206
|
-
* <button onClick={() => viewer.commands.historyForward.exec()}>Forward</button>
|
|
1207
|
-
* </>
|
|
1208
|
-
* );
|
|
1268
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1269
|
+
* // Navigate forward to the next report in history
|
|
1270
|
+
* reportViewerRef.current.commands.historyForward.exec();
|
|
1209
1271
|
* @example <propertyName>historyForward</propertyName>
|
|
1272
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1210
1273
|
* // Check if the command is enabled
|
|
1211
|
-
* const isEnabled =
|
|
1274
|
+
* const isEnabled = reportViewerRef.current.commands.historyForward.enabled();
|
|
1212
1275
|
* @example <propertyName>historyForward</propertyName>
|
|
1276
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1213
1277
|
* // Check if the command is checked
|
|
1214
|
-
* const isChecked =
|
|
1278
|
+
* const isChecked = reportViewerRef.current.commands.historyForward.checked();
|
|
1279
|
+
*
|
|
1215
1280
|
* @property {ReportViewerCommand} refresh - Refreshes the report.
|
|
1216
1281
|
* @example <propertyName>refresh</propertyName>
|
|
1217
|
-
* //
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
* <>
|
|
1221
|
-
* <TelerikReportViewer />
|
|
1222
|
-
* <button onClick={() => viewer.commands.refresh.exec()}>Refresh</button>
|
|
1223
|
-
* </>
|
|
1224
|
-
* );
|
|
1282
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1283
|
+
* // Refresh the current report
|
|
1284
|
+
* reportViewerRef.current.commands.refresh.exec();
|
|
1225
1285
|
* @example <propertyName>refresh</propertyName>
|
|
1286
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1226
1287
|
* // Check if the command is enabled
|
|
1227
|
-
* const isEnabled =
|
|
1288
|
+
* const isEnabled = reportViewerRef.current.commands.refresh.enabled();
|
|
1228
1289
|
* @example <propertyName>refresh</propertyName>
|
|
1290
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1229
1291
|
* // Check if the command is checked
|
|
1230
|
-
* const isChecked =
|
|
1292
|
+
* const isChecked = reportViewerRef.current.commands.refresh.checked();
|
|
1293
|
+
*
|
|
1231
1294
|
* @property {ReportViewerCommand} goToFirstPage - Goes to the first page of the report.
|
|
1232
1295
|
* @example <propertyName>goToFirstPage</propertyName>
|
|
1233
|
-
* //
|
|
1234
|
-
*
|
|
1235
|
-
*
|
|
1236
|
-
* <>
|
|
1237
|
-
* <TelerikReportViewer />
|
|
1238
|
-
* <button onClick={() => viewer.commands.goToFirstPage.exec()}>First Page</button>
|
|
1239
|
-
* </>
|
|
1240
|
-
* );
|
|
1296
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1297
|
+
* // Navigate to the first page
|
|
1298
|
+
* reportViewerRef.current.commands.goToFirstPage.exec();
|
|
1241
1299
|
* @example <propertyName>goToFirstPage</propertyName>
|
|
1300
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1242
1301
|
* // Check if the command is enabled
|
|
1243
|
-
* const isEnabled =
|
|
1302
|
+
* const isEnabled = reportViewerRef.current.commands.goToFirstPage.enabled();
|
|
1244
1303
|
* @example <propertyName>goToFirstPage</propertyName>
|
|
1304
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1245
1305
|
* // Check if the command is checked
|
|
1246
|
-
* const isChecked =
|
|
1306
|
+
* const isChecked = reportViewerRef.current.commands.goToFirstPage.checked();
|
|
1307
|
+
*
|
|
1247
1308
|
* @property {ReportViewerCommand} goToPrevPage - Goes to the previous page of the report.
|
|
1248
1309
|
* @example <propertyName>goToPrevPage</propertyName>
|
|
1249
|
-
* //
|
|
1250
|
-
*
|
|
1251
|
-
*
|
|
1252
|
-
* <>
|
|
1253
|
-
* <TelerikReportViewer />
|
|
1254
|
-
* <button onClick={() => viewer.commands.goToPrevPage.exec()}>Previous</button>
|
|
1255
|
-
* </>
|
|
1256
|
-
* );
|
|
1310
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1311
|
+
* // Navigate to the previous page
|
|
1312
|
+
* reportViewerRef.current.commands.goToPrevPage.exec();
|
|
1257
1313
|
* @example <propertyName>goToPrevPage</propertyName>
|
|
1314
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1258
1315
|
* // Check if the command is enabled
|
|
1259
|
-
* const isEnabled =
|
|
1316
|
+
* const isEnabled = reportViewerRef.current.commands.goToPrevPage.enabled();
|
|
1260
1317
|
* @example <propertyName>goToPrevPage</propertyName>
|
|
1318
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1261
1319
|
* // Check if the command is checked
|
|
1262
|
-
* const isChecked =
|
|
1263
|
-
*
|
|
1320
|
+
* const isChecked = reportViewerRef.current.commands.goToPrevPage.checked();
|
|
1321
|
+
*
|
|
1322
|
+
* @property {ReportViewerCommand} goToPage - Goes to a specific page of the report. Pass the page number to exec().
|
|
1264
1323
|
* @example <propertyName>goToPage</propertyName>
|
|
1265
|
-
* //
|
|
1266
|
-
*
|
|
1267
|
-
*
|
|
1268
|
-
* <>
|
|
1269
|
-
* <TelerikReportViewer />
|
|
1270
|
-
* <button onClick={() => viewer.commands.goToPage.exec(5)}>Go to Page 5</button>
|
|
1271
|
-
* </>
|
|
1272
|
-
* );
|
|
1324
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1325
|
+
* // Navigate to page 5
|
|
1326
|
+
* reportViewerRef.current.commands.goToPage.exec(5);
|
|
1273
1327
|
* @example <propertyName>goToPage</propertyName>
|
|
1328
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1274
1329
|
* // Check if the command is enabled
|
|
1275
|
-
* const isEnabled =
|
|
1330
|
+
* const isEnabled = reportViewerRef.current.commands.goToPage.enabled();
|
|
1276
1331
|
* @example <propertyName>goToPage</propertyName>
|
|
1332
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1277
1333
|
* // Check if the command is checked
|
|
1278
|
-
* const isChecked =
|
|
1334
|
+
* const isChecked = reportViewerRef.current.commands.goToPage.checked();
|
|
1335
|
+
*
|
|
1279
1336
|
* @property {ReportViewerCommand} goToNextPage - Goes to the next page of the report.
|
|
1280
1337
|
* @example <propertyName>goToNextPage</propertyName>
|
|
1281
|
-
* //
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1284
|
-
* <>
|
|
1285
|
-
* <TelerikReportViewer />
|
|
1286
|
-
* <button onClick={() => viewer.commands.goToNextPage.exec()}>Next</button>
|
|
1287
|
-
* </>
|
|
1288
|
-
* );
|
|
1338
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1339
|
+
* // Navigate to the next page
|
|
1340
|
+
* reportViewerRef.current.commands.goToNextPage.exec();
|
|
1289
1341
|
* @example <propertyName>goToNextPage</propertyName>
|
|
1342
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1290
1343
|
* // Check if the command is enabled
|
|
1291
|
-
* const isEnabled =
|
|
1344
|
+
* const isEnabled = reportViewerRef.current.commands.goToNextPage.enabled();
|
|
1292
1345
|
* @example <propertyName>goToNextPage</propertyName>
|
|
1346
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1293
1347
|
* // Check if the command is checked
|
|
1294
|
-
* const isChecked =
|
|
1348
|
+
* const isChecked = reportViewerRef.current.commands.goToNextPage.checked();
|
|
1349
|
+
*
|
|
1295
1350
|
* @property {ReportViewerCommand} goToLastPage - Goes to the last page of the report.
|
|
1296
1351
|
* @example <propertyName>goToLastPage</propertyName>
|
|
1297
|
-
* //
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
1300
|
-
* <>
|
|
1301
|
-
* <TelerikReportViewer />
|
|
1302
|
-
* <button onClick={() => viewer.commands.goToLastPage.exec()}>Last Page</button>
|
|
1303
|
-
* </>
|
|
1304
|
-
* );
|
|
1352
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1353
|
+
* // Navigate to the last page
|
|
1354
|
+
* reportViewerRef.current.commands.goToLastPage.exec();
|
|
1305
1355
|
* @example <propertyName>goToLastPage</propertyName>
|
|
1356
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1306
1357
|
* // Check if the command is enabled
|
|
1307
|
-
* const isEnabled =
|
|
1358
|
+
* const isEnabled = reportViewerRef.current.commands.goToLastPage.enabled();
|
|
1308
1359
|
* @example <propertyName>goToLastPage</propertyName>
|
|
1360
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1309
1361
|
* // Check if the command is checked
|
|
1310
|
-
* const isChecked =
|
|
1362
|
+
* const isChecked = reportViewerRef.current.commands.goToLastPage.checked();
|
|
1363
|
+
*
|
|
1311
1364
|
* @property {ReportViewerCommand} togglePrintPreview - Toggles between Print Preview and Interactive view modes.
|
|
1312
1365
|
* @example <propertyName>togglePrintPreview</propertyName>
|
|
1313
|
-
* //
|
|
1314
|
-
*
|
|
1315
|
-
*
|
|
1316
|
-
* <>
|
|
1317
|
-
* <TelerikReportViewer />
|
|
1318
|
-
* <button onClick={() => viewer.commands.togglePrintPreview.exec()}>Toggle Print Preview</button>
|
|
1319
|
-
* </>
|
|
1320
|
-
* );
|
|
1366
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1367
|
+
* // Toggle between Print Preview and Interactive modes
|
|
1368
|
+
* reportViewerRef.current.commands.togglePrintPreview.exec();
|
|
1321
1369
|
* @example <propertyName>togglePrintPreview</propertyName>
|
|
1370
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1322
1371
|
* // Check if the command is enabled
|
|
1323
|
-
* const isEnabled =
|
|
1372
|
+
* const isEnabled = reportViewerRef.current.commands.togglePrintPreview.enabled();
|
|
1324
1373
|
* @example <propertyName>togglePrintPreview</propertyName>
|
|
1325
|
-
* //
|
|
1326
|
-
*
|
|
1327
|
-
*
|
|
1374
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1375
|
+
* // Check if the command is checked (true when in Print Preview mode)
|
|
1376
|
+
* const isChecked = reportViewerRef.current.commands.togglePrintPreview.checked();
|
|
1377
|
+
*
|
|
1378
|
+
* @property {ReportViewerCommand} export - Exports the report. Pass the rendering extension name to exec() (e.g., "PDF", "XLSX", "CSV", "DOCX").
|
|
1379
|
+
* @example <propertyName>export</propertyName>
|
|
1380
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1381
|
+
* // Export the report as PDF
|
|
1382
|
+
* reportViewerRef.current.commands.export.exec("PDF");
|
|
1328
1383
|
* @example <propertyName>export</propertyName>
|
|
1329
|
-
* //
|
|
1330
|
-
* let viewer;
|
|
1331
|
-
* ReactDOM.render(
|
|
1332
|
-
* <>
|
|
1333
|
-
* <TelerikReportViewer />
|
|
1334
|
-
* <button onClick={() => viewer.commands.export.exec('PDF')}>Export PDF</button>
|
|
1335
|
-
* </>
|
|
1336
|
-
* );
|
|
1337
|
-
* @example <propertyName>export</propertyName>
|
|
1384
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1338
1385
|
* // Check if the command is enabled
|
|
1339
|
-
* const isEnabled =
|
|
1386
|
+
* const isEnabled = reportViewerRef.current.commands.export.enabled();
|
|
1340
1387
|
* @example <propertyName>export</propertyName>
|
|
1388
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1341
1389
|
* // Check if the command is checked
|
|
1342
|
-
* const isChecked =
|
|
1390
|
+
* const isChecked = reportViewerRef.current.commands.export.checked();
|
|
1391
|
+
*
|
|
1343
1392
|
* @property {ReportViewerCommand} print - Triggers the report printing.
|
|
1344
1393
|
* @example <propertyName>print</propertyName>
|
|
1345
|
-
* //
|
|
1346
|
-
*
|
|
1347
|
-
*
|
|
1348
|
-
* <>
|
|
1349
|
-
* <TelerikReportViewer />
|
|
1350
|
-
* <button onClick={() => viewer.commands.print.exec()}>Print</button>
|
|
1351
|
-
* </>
|
|
1352
|
-
* );
|
|
1394
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1395
|
+
* // Print the current report
|
|
1396
|
+
* reportViewerRef.current.commands.print.exec();
|
|
1353
1397
|
* @example <propertyName>print</propertyName>
|
|
1398
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1354
1399
|
* // Check if the command is enabled
|
|
1355
|
-
* const isEnabled =
|
|
1400
|
+
* const isEnabled = reportViewerRef.current.commands.print.enabled();
|
|
1356
1401
|
* @example <propertyName>print</propertyName>
|
|
1402
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1357
1403
|
* // Check if the command is checked
|
|
1358
|
-
* const isChecked =
|
|
1404
|
+
* const isChecked = reportViewerRef.current.commands.print.checked();
|
|
1405
|
+
*
|
|
1359
1406
|
* @property {ReportViewerCommand} toggleDocumentMap - Shows or hides the document map.
|
|
1360
1407
|
* @example <propertyName>toggleDocumentMap</propertyName>
|
|
1361
|
-
* //
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
* <>
|
|
1365
|
-
* <TelerikReportViewer />
|
|
1366
|
-
* <button onClick={() => viewer.commands.toggleDocumentMap.exec()}>Toggle Document Map</button>
|
|
1367
|
-
* </>
|
|
1368
|
-
* );
|
|
1408
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1409
|
+
* // Toggle the document map visibility
|
|
1410
|
+
* reportViewerRef.current.commands.toggleDocumentMap.exec();
|
|
1369
1411
|
* @example <propertyName>toggleDocumentMap</propertyName>
|
|
1412
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1370
1413
|
* // Check if the command is enabled
|
|
1371
|
-
* const isEnabled =
|
|
1414
|
+
* const isEnabled = reportViewerRef.current.commands.toggleDocumentMap.enabled();
|
|
1372
1415
|
* @example <propertyName>toggleDocumentMap</propertyName>
|
|
1373
|
-
* //
|
|
1374
|
-
*
|
|
1416
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1417
|
+
* // Check if the command is checked (true when document map is visible)
|
|
1418
|
+
* const isChecked = reportViewerRef.current.commands.toggleDocumentMap.checked();
|
|
1419
|
+
*
|
|
1375
1420
|
* @property {ReportViewerCommand} toggleParametersArea - Shows or hides the parameters area.
|
|
1376
1421
|
* @example <propertyName>toggleParametersArea</propertyName>
|
|
1377
|
-
* //
|
|
1378
|
-
*
|
|
1379
|
-
*
|
|
1380
|
-
* <>
|
|
1381
|
-
* <TelerikReportViewer />
|
|
1382
|
-
* <button onClick={() => viewer.commands.toggleParametersArea.exec()}>Toggle Parameters</button>
|
|
1383
|
-
* </>
|
|
1384
|
-
* );
|
|
1422
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1423
|
+
* // Toggle the parameters area visibility
|
|
1424
|
+
* reportViewerRef.current.commands.toggleParametersArea.exec();
|
|
1385
1425
|
* @example <propertyName>toggleParametersArea</propertyName>
|
|
1426
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1386
1427
|
* // Check if the command is enabled
|
|
1387
|
-
* const isEnabled =
|
|
1428
|
+
* const isEnabled = reportViewerRef.current.commands.toggleParametersArea.enabled();
|
|
1388
1429
|
* @example <propertyName>toggleParametersArea</propertyName>
|
|
1389
|
-
* //
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1430
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1431
|
+
* // Check if the command is checked (true when parameters area is visible)
|
|
1432
|
+
* const isChecked = reportViewerRef.current.commands.toggleParametersArea.checked();
|
|
1433
|
+
*
|
|
1434
|
+
* @property {ReportViewerCommand} zoomIn - Zooms in on the report.
|
|
1392
1435
|
* @example <propertyName>zoomIn</propertyName>
|
|
1393
|
-
* //
|
|
1394
|
-
*
|
|
1395
|
-
*
|
|
1396
|
-
* <>
|
|
1397
|
-
* <TelerikReportViewer />
|
|
1398
|
-
* <button onClick={() => viewer.commands.zoomIn.exec()}>Zoom In</button>
|
|
1399
|
-
* </>
|
|
1400
|
-
* );
|
|
1436
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1437
|
+
* // Zoom in on the report
|
|
1438
|
+
* reportViewerRef.current.commands.zoomIn.exec();
|
|
1401
1439
|
* @example <propertyName>zoomIn</propertyName>
|
|
1440
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1402
1441
|
* // Check if the command is enabled
|
|
1403
|
-
* const isEnabled =
|
|
1442
|
+
* const isEnabled = reportViewerRef.current.commands.zoomIn.enabled();
|
|
1404
1443
|
* @example <propertyName>zoomIn</propertyName>
|
|
1444
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1405
1445
|
* // Check if the command is checked
|
|
1406
|
-
* const isChecked =
|
|
1407
|
-
*
|
|
1446
|
+
* const isChecked = reportViewerRef.current.commands.zoomIn.checked();
|
|
1447
|
+
*
|
|
1448
|
+
* @property {ReportViewerCommand} zoomOut - Zooms out of the report.
|
|
1408
1449
|
* @example <propertyName>zoomOut</propertyName>
|
|
1409
|
-
* //
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
1412
|
-
* <>
|
|
1413
|
-
* <TelerikReportViewer />
|
|
1414
|
-
* <button onClick={() => viewer.commands.zoomOut.exec()}>Zoom Out</button>
|
|
1415
|
-
* </>
|
|
1416
|
-
* );
|
|
1450
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1451
|
+
* // Zoom out of the report
|
|
1452
|
+
* reportViewerRef.current.commands.zoomOut.exec();
|
|
1417
1453
|
* @example <propertyName>zoomOut</propertyName>
|
|
1454
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1418
1455
|
* // Check if the command is enabled
|
|
1419
|
-
* const isEnabled =
|
|
1456
|
+
* const isEnabled = reportViewerRef.current.commands.zoomOut.enabled();
|
|
1420
1457
|
* @example <propertyName>zoomOut</propertyName>
|
|
1458
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1421
1459
|
* // Check if the command is checked
|
|
1422
|
-
* const isChecked =
|
|
1423
|
-
*
|
|
1460
|
+
* const isChecked = reportViewerRef.current.commands.zoomOut.checked();
|
|
1461
|
+
*
|
|
1462
|
+
* @property {ReportViewerCommand} zoom - Zooms to a specified ratio. Pass the zoom ratio to exec() (e.g., 1.5 for 150%).
|
|
1424
1463
|
* @example <propertyName>zoom</propertyName>
|
|
1425
|
-
* //
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1428
|
-
* <>
|
|
1429
|
-
* <TelerikReportViewer />
|
|
1430
|
-
* <button onClick={() => viewer.commands.zoom.exec(1.5)}>Zoom 150%</button>
|
|
1431
|
-
* </>
|
|
1432
|
-
* );
|
|
1464
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1465
|
+
* // Zoom to 150%
|
|
1466
|
+
* reportViewerRef.current.commands.zoom.exec(1.5);
|
|
1433
1467
|
* @example <propertyName>zoom</propertyName>
|
|
1468
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1434
1469
|
* // Check if the command is enabled
|
|
1435
|
-
* const isEnabled =
|
|
1470
|
+
* const isEnabled = reportViewerRef.current.commands.zoom.enabled();
|
|
1436
1471
|
* @example <propertyName>zoom</propertyName>
|
|
1472
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1437
1473
|
* // Check if the command is checked
|
|
1438
|
-
* const isChecked =
|
|
1439
|
-
*
|
|
1474
|
+
* const isChecked = reportViewerRef.current.commands.zoom.checked();
|
|
1475
|
+
*
|
|
1476
|
+
* @property {ReportViewerCommand} toggleZoomMode - Cycles the zoom mode of the report between FIT_PAGE_WIDTH, FIT_PAGE, and SPECIFIC.
|
|
1440
1477
|
* @example <propertyName>toggleZoomMode</propertyName>
|
|
1441
|
-
* //
|
|
1442
|
-
*
|
|
1443
|
-
*
|
|
1444
|
-
* <>
|
|
1445
|
-
* <TelerikReportViewer />
|
|
1446
|
-
* <button onClick={() => viewer.commands.toggleZoomMode.exec()}>Toggle Zoom Mode</button>
|
|
1447
|
-
* </>
|
|
1448
|
-
* );
|
|
1478
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1479
|
+
* // Cycle to the next zoom mode
|
|
1480
|
+
* reportViewerRef.current.commands.toggleZoomMode.exec();
|
|
1449
1481
|
* @example <propertyName>toggleZoomMode</propertyName>
|
|
1482
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1450
1483
|
* // Check if the command is enabled
|
|
1451
|
-
* const isEnabled =
|
|
1484
|
+
* const isEnabled = reportViewerRef.current.commands.toggleZoomMode.enabled();
|
|
1452
1485
|
* @example <propertyName>toggleZoomMode</propertyName>
|
|
1486
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1453
1487
|
* // Check if the command is checked
|
|
1454
|
-
* const isChecked =
|
|
1455
|
-
*
|
|
1456
|
-
* @example <propertyName>toggleSideMenu</propertyName>
|
|
1457
|
-
* // Execute the command
|
|
1458
|
-
* let viewer;
|
|
1459
|
-
* ReactDOM.render(
|
|
1460
|
-
* <>
|
|
1461
|
-
* <TelerikReportViewer />
|
|
1462
|
-
* <button onClick={() => viewer.commands.toggleSideMenu.exec()}>Toggle Side Menu</button>
|
|
1463
|
-
* </>
|
|
1464
|
-
* );
|
|
1465
|
-
* @example <propertyName>toggleSideMenu</propertyName>
|
|
1466
|
-
* // Check if the command is enabled
|
|
1467
|
-
* const isEnabled = viewer.commands.toggleSideMenu.enabled();
|
|
1468
|
-
* @example <propertyName>toggleSideMenu</propertyName>
|
|
1469
|
-
* // Check if the command is checked
|
|
1470
|
-
* const isChecked = viewer.commands.toggleSideMenu.checked();
|
|
1488
|
+
* const isChecked = reportViewerRef.current.commands.toggleZoomMode.checked();
|
|
1489
|
+
*
|
|
1471
1490
|
* @property {ReportViewerCommand} toggleSearchDialog - Shows or hides the search dialog.
|
|
1472
1491
|
* @example <propertyName>toggleSearchDialog</propertyName>
|
|
1473
|
-
* //
|
|
1474
|
-
*
|
|
1475
|
-
*
|
|
1476
|
-
* <>
|
|
1477
|
-
* <TelerikReportViewer />
|
|
1478
|
-
* <button onClick={() => viewer.commands.toggleSearchDialog.exec()}>Toggle Search</button>
|
|
1479
|
-
* </>
|
|
1480
|
-
* );
|
|
1492
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1493
|
+
* // Toggle the search dialog visibility
|
|
1494
|
+
* reportViewerRef.current.commands.toggleSearchDialog.exec();
|
|
1481
1495
|
* @example <propertyName>toggleSearchDialog</propertyName>
|
|
1496
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1482
1497
|
* // Check if the command is enabled
|
|
1483
|
-
* const isEnabled =
|
|
1498
|
+
* const isEnabled = reportViewerRef.current.commands.toggleSearchDialog.enabled();
|
|
1484
1499
|
* @example <propertyName>toggleSearchDialog</propertyName>
|
|
1485
|
-
* //
|
|
1486
|
-
*
|
|
1500
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1501
|
+
* // Check if the command is checked (true when search dialog is visible)
|
|
1502
|
+
* const isChecked = reportViewerRef.current.commands.toggleSearchDialog.checked();
|
|
1503
|
+
*
|
|
1487
1504
|
* @property {ReportViewerCommand} stopRendering - Stops the rendering of the current report.
|
|
1488
1505
|
* @example <propertyName>stopRendering</propertyName>
|
|
1489
|
-
* //
|
|
1490
|
-
*
|
|
1491
|
-
*
|
|
1492
|
-
* <>
|
|
1493
|
-
* <TelerikReportViewer />
|
|
1494
|
-
* <button onClick={() => viewer.commands.stopRendering.exec()}>Stop Rendering</button>
|
|
1495
|
-
* </>
|
|
1496
|
-
* );
|
|
1506
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1507
|
+
* // Stop the current report rendering
|
|
1508
|
+
* reportViewerRef.current.commands.stopRendering.exec();
|
|
1497
1509
|
* @example <propertyName>stopRendering</propertyName>
|
|
1510
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1498
1511
|
* // Check if the command is enabled
|
|
1499
|
-
* const isEnabled =
|
|
1512
|
+
* const isEnabled = reportViewerRef.current.commands.stopRendering.enabled();
|
|
1500
1513
|
* @example <propertyName>stopRendering</propertyName>
|
|
1514
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1501
1515
|
* // Check if the command is checked
|
|
1502
|
-
* const isChecked =
|
|
1516
|
+
* const isChecked = reportViewerRef.current.commands.stopRendering.checked();
|
|
1517
|
+
*
|
|
1503
1518
|
* @property {ReportViewerCommand} toggleSendEmailDialog - Shows or hides the send email dialog.
|
|
1504
1519
|
* @example <propertyName>toggleSendEmailDialog</propertyName>
|
|
1505
|
-
* //
|
|
1506
|
-
*
|
|
1507
|
-
*
|
|
1508
|
-
* <>
|
|
1509
|
-
* <TelerikReportViewer />
|
|
1510
|
-
* <button onClick={() => viewer.commands.toggleSendEmailDialog.exec()}>Toggle Send Email</button>
|
|
1511
|
-
* </>
|
|
1512
|
-
* );
|
|
1520
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1521
|
+
* // Toggle the send email dialog visibility
|
|
1522
|
+
* reportViewerRef.current.commands.toggleSendEmailDialog.exec();
|
|
1513
1523
|
* @example <propertyName>toggleSendEmailDialog</propertyName>
|
|
1524
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1514
1525
|
* // Check if the command is enabled
|
|
1515
|
-
* const isEnabled =
|
|
1526
|
+
* const isEnabled = reportViewerRef.current.commands.toggleSendEmailDialog.enabled();
|
|
1516
1527
|
* @example <propertyName>toggleSendEmailDialog</propertyName>
|
|
1517
|
-
* //
|
|
1518
|
-
*
|
|
1528
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1529
|
+
* // Check if the command is checked (true when send email dialog is visible)
|
|
1530
|
+
* const isChecked = reportViewerRef.current.commands.toggleSendEmailDialog.checked();
|
|
1531
|
+
*
|
|
1519
1532
|
* @property {ReportViewerCommand} toggleAiPromptDialog - Shows or hides the AI prompt dialog.
|
|
1520
1533
|
* @example <propertyName>toggleAiPromptDialog</propertyName>
|
|
1521
|
-
* //
|
|
1522
|
-
*
|
|
1523
|
-
*
|
|
1524
|
-
* <>
|
|
1525
|
-
* <TelerikReportViewer />
|
|
1526
|
-
* <button onClick={() => viewer.commands.toggleAiPromptDialog.exec()}>Toggle AI Prompt</button>
|
|
1527
|
-
* </>
|
|
1528
|
-
* );
|
|
1534
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1535
|
+
* // Toggle the AI prompt dialog visibility
|
|
1536
|
+
* reportViewerRef.current.commands.toggleAiPromptDialog.exec();
|
|
1529
1537
|
* @example <propertyName>toggleAiPromptDialog</propertyName>
|
|
1538
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1530
1539
|
* // Check if the command is enabled
|
|
1531
|
-
* const isEnabled =
|
|
1540
|
+
* const isEnabled = reportViewerRef.current.commands.toggleAiPromptDialog.enabled();
|
|
1532
1541
|
* @example <propertyName>toggleAiPromptDialog</propertyName>
|
|
1533
|
-
* //
|
|
1534
|
-
*
|
|
1542
|
+
* // Assume reportViewerRef = useRef(null) and pass it to the component ref prop.
|
|
1543
|
+
* // Check if the command is checked (true when AI prompt dialog is visible)
|
|
1544
|
+
* const isChecked = reportViewerRef.current.commands.toggleAiPromptDialog.checked();
|
|
1535
1545
|
*/
|