@progress/telerik-jquery-report-viewer 23.24.806 → 24.24.1112

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This package is part of [Telerik Reporting](https://www.telerik.com/reporting).
4
4
 
5
- This version of Telerik jQuery Report Viewer requires Telerik Report Server or Telerik Reporting REST Service 18.2.24.806.
5
+ This version of Telerik jQuery Report Viewer requires Telerik Report Server or Telerik Reporting REST Service 18.3.24.1112.
6
6
 
7
7
  __Intended for internal purposes only.__
8
8
 
@@ -71,8 +71,8 @@ function Accessibility(options) {
71
71
  }
72
72
  function setPageSelector() {
73
73
  var pagers = document.querySelectorAll(".trv-report-pager");
74
- var pageNumber = this._controller.getCurrentPageNumber();
75
- var pageCount = this._controller.getPageCount();
74
+ var pageNumber = controller.getCurrentPageNumber();
75
+ var pageCount = controller.getPageCount();
76
76
  pagers.forEach((pager) => {
77
77
  pager.setAttribute("aria-label", utils.stringFormat(stringResources.stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
78
78
  var pageInputs = pager.querySelectorAll("input[data-role=telerik_ReportViewer_PageNumberInput]");
@@ -80,7 +80,7 @@ function CommandSet(options) {
80
80
  }),
81
81
  "refresh": new command.Command(
82
82
  function() {
83
- controller.refreshReport(true);
83
+ controller.refreshReport(true, false);
84
84
  }
85
85
  ),
86
86
  "export": new command.Command(function(format) {
@@ -618,7 +618,7 @@ function ReportViewerController(options) {
618
618
  report: args.Report,
619
619
  parameters: fixDataContractJsonSerializer(args.ParameterValues)
620
620
  });
621
- controller.refreshReport(false);
621
+ controller.refreshReport(false, true);
622
622
  },
623
623
  "navigateToUrl": function(action) {
624
624
  var args = action.Value;
@@ -730,6 +730,7 @@ function ReportViewerController(options) {
730
730
  UPDATE_UI: "trv.UPDATE_UI",
731
731
  CSS_LOADED: "cssLoaded",
732
732
  RELOAD_PARAMETERS: "reloadParameters",
733
+ PARAMETERS_LOADED: "parametersLoaded",
733
734
  INTERACTIVE_ACTION_EXECUTING: "interactiveActionExecuting",
734
735
  INTERACTIVE_ACTION_ENTER: "interactiveActionEnter",
735
736
  INTERACTIVE_ACTION_LEAVE: "interactiveActionLeave",
@@ -779,7 +780,7 @@ function ReportViewerController(options) {
779
780
  return this;
780
781
  }
781
782
  report = rs.report;
782
- parameterValues = rs.parameters;
783
+ controller.setParameters(rs.parameters);
783
784
  changeReportSource(rs);
784
785
  return this;
785
786
  },
@@ -800,6 +801,7 @@ function ReportViewerController(options) {
800
801
  },
801
802
  setParameters: function(paramValues) {
802
803
  parameterValues = paramValues;
804
+ controller.parametersLoaded();
803
805
  },
804
806
  setProcessedParameter: function(processedParamValues) {
805
807
  processedParameterValues = processedParamValues;
@@ -877,6 +879,7 @@ function ReportViewerController(options) {
877
879
  },
878
880
  previewReport: function(ignoreCache, baseDocumentId, actionId) {
879
881
  controller.loadedReportChange();
882
+ controller.respectReportAutoRun = false;
880
883
  controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
881
884
  },
882
885
  refreshReportCore: function(ignoreCache, baseDocumentId, actionId) {
@@ -914,7 +917,7 @@ function ReportViewerController(options) {
914
917
  }
915
918
  return paramsToBeExposed;
916
919
  },
917
- refreshReport: function(ignoreCache, baseDocumentId, actionId) {
920
+ refreshReport: function(ignoreCache, respectAutoRun, baseDocumentId, actionId) {
918
921
  controller.loadedReportChange();
919
922
  if (clientHasExpired) {
920
923
  clientHasExpired = false;
@@ -944,12 +947,25 @@ function ReportViewerController(options) {
944
947
  appendInvalidReportParameterNames(invalidParameters);
945
948
  controller.missingOrInvalidParameters();
946
949
  } else {
950
+ controller.respectReportAutoRun = respectAutoRun;
947
951
  controller.setParameters(parameterValues2);
948
- controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
952
+ if (controller.isReportAutoRun()) {
953
+ controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
954
+ } else {
955
+ controller.showNotification({ stringResources: "autoRunDisabled" });
956
+ }
949
957
  }
950
958
  });
951
959
  controller.reloadParameters(loadParametersPromise);
952
960
  },
961
+ isReportAutoRun: function() {
962
+ var _a;
963
+ var reportAutoRunParameter = true;
964
+ if (parameterValues) {
965
+ reportAutoRunParameter = (_a = parameterValues.trv_AutoRun) != null ? _a : true;
966
+ }
967
+ return !controller.respectReportAutoRun || reportAutoRunParameter;
968
+ },
953
969
  exportReport: function(format, deviceInfo) {
954
970
  exportReport(format, deviceInfo);
955
971
  },
@@ -1031,6 +1047,9 @@ function ReportViewerController(options) {
1031
1047
  reloadParameters: function(...args) {
1032
1048
  return eventFactory(controller.Events.RELOAD_PARAMETERS, args);
1033
1049
  },
1050
+ parametersLoaded: function(...args) {
1051
+ return eventFactory(controller.Events.PARAMETERS_LOADED, args);
1052
+ },
1034
1053
  exportStarted: function(...args) {
1035
1054
  return eventFactory(controller.Events.EXPORT_STARTED, args);
1036
1055
  },
@@ -49,6 +49,16 @@ function DocumentMapArea(placeholder, options, otherOptions) {
49
49
  $li.attr("aria-label", $li[0].innerText);
50
50
  });
51
51
  }
52
+ function resetReportAndClearItems() {
53
+ documentMapNecessary = false;
54
+ showDocumentMap(false);
55
+ var r = controller.getReportSource().report;
56
+ var clearMapItems = currentReport !== r || !isVisible();
57
+ currentReport = r;
58
+ if (clearMapItems) {
59
+ clearDocumentMap();
60
+ }
61
+ }
52
62
  function clearDocumentMap() {
53
63
  displayDocumentMap([]);
54
64
  }
@@ -114,14 +124,10 @@ function DocumentMapArea(placeholder, options, otherOptions) {
114
124
  }
115
125
  }
116
126
  function attach() {
117
- controller.beginLoadReport(function() {
127
+ controller.beforeLoadParameters(function() {
128
+ resetReportAndClearItems();
129
+ }).beginLoadReport(function() {
118
130
  beginLoad();
119
- var r = controller.getReportSource().report;
120
- var clearMapItems = currentReport !== r || !isVisible();
121
- currentReport = r;
122
- if (clearMapItems) {
123
- clearDocumentMap();
124
- }
125
131
  }).reportLoadComplete(function(event, args) {
126
132
  if (args.documentMapAvailable) {
127
133
  documentMapNecessary = true;
@@ -17,7 +17,8 @@ const Events = {
17
17
  INTERACTIVE_ACTION_LEAVE: "INTERACTIVE_ACTION_LEAVE",
18
18
  VIEWER_TOOLTIP_OPENING: "VIEWER_TOOLTIP_OPENING",
19
19
  SEND_EMAIL_BEGIN: "SEND_EMAIL_BEGIN",
20
- SEND_EMAIL_END: "SEND_EMAIL_END"
20
+ SEND_EMAIL_END: "SEND_EMAIL_END",
21
+ PARAMETERS_LOADED: "PARAMETERS_LOADED"
21
22
  };
22
23
 
23
24
  exports.Events = Events;
@@ -63,11 +63,11 @@ function HistoryManager(options) {
63
63
  });
64
64
  }
65
65
  }
66
- function exec(currentRecord) {
66
+ function exec(currentRecord, reportChanged) {
67
67
  controller.setReportDocumentId(currentRecord.reportDocumentId);
68
68
  controller.setViewMode(currentRecord.viewMode);
69
69
  controller.setReportSource(currentRecord.reportSource);
70
- controller.refreshReport(false, currentRecord.reportDocumentId);
70
+ controller.refreshReport(false, reportChanged, currentRecord.reportDocumentId);
71
71
  controller.navigateToPage(currentRecord.pageNumber);
72
72
  }
73
73
  function canMove(step) {
@@ -86,9 +86,13 @@ function HistoryManager(options) {
86
86
  newPos = length - 1;
87
87
  }
88
88
  if (newPos != position) {
89
+ var currentRecord = getCurrentRecord();
90
+ var currentReport = currentRecord.reportSource ? currentRecord.reportSource.report : "";
89
91
  history.position = newPos;
90
92
  saveSettings();
91
- exec(getCurrentRecord());
93
+ var newRecord = getCurrentRecord();
94
+ var newReport = newRecord.reportSource ? newRecord.reportSource.report : "";
95
+ exec(newRecord, currentReport !== newReport);
92
96
  }
93
97
  }
94
98
  function removeTempRecordsFromHistory() {
@@ -121,7 +125,7 @@ function HistoryManager(options) {
121
125
  loadCurrent: function() {
122
126
  var rec = getCurrentRecord();
123
127
  if (rec) {
124
- exec(rec);
128
+ exec(rec, false);
125
129
  }
126
130
  return Boolean(rec);
127
131
  }
@@ -95,7 +95,8 @@ function PagesArea(placeholder, options, otherOptions) {
95
95
  documentReady = false;
96
96
  }).beforeLoadParameters(function(event, initial) {
97
97
  if (initial) {
98
- showError(stringResources.stringResources.loadingReport);
98
+ clearPendingTimeoutIds();
99
+ showError(stringResources.stringResources.loadingParameters);
99
100
  }
100
101
  }).beforeLoadReport(function() {
101
102
  documentReady = false;
@@ -105,7 +106,9 @@ function PagesArea(placeholder, options, otherOptions) {
105
106
  clearPendingTimeoutIds();
106
107
  clear();
107
108
  disablePagesArea(true);
108
- showError(stringResources.stringResources.loadingReport);
109
+ if (controller.isReportAutoRun()) {
110
+ showError(stringResources.stringResources.loadingReport);
111
+ }
109
112
  }).beginLoadReport(function(event, args) {
110
113
  documentReady = true;
111
114
  invalidateCurrentlyLoadedPage();
@@ -170,7 +170,7 @@ function ParametersArea(placeholder, options, otherOptions) {
170
170
  (error ? $.fn.addClass : $.fn.removeClass).call($placeholder, "trv-error");
171
171
  }
172
172
  function showPreviewButton() {
173
- (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
173
+ (allParametersAutoRefresh() && controller.isReportAutoRun() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
174
174
  }
175
175
  function allParametersAutoRefresh() {
176
176
  var allAuto = Array.from(parameters$1).every((parameter) => {
@@ -358,10 +358,7 @@ function ParametersArea(placeholder, options, otherOptions) {
358
358
  }
359
359
  var parametersAreaNecessary = false;
360
360
  function onLoadParametersComplete(params, successAction) {
361
- parametersAreaNecessary = hasVisibleParameters(params);
362
- if (!parametersAreaNecessary) {
363
- showParametersArea(false);
364
- }
361
+ showParametersAreaIfNecessary(params);
365
362
  fill(params);
366
363
  showError("");
367
364
  if (parametersAreaNecessary && parametersAreaVisible) {
@@ -376,6 +373,10 @@ function ParametersArea(placeholder, options, otherOptions) {
376
373
  }
377
374
  endLoad();
378
375
  }
376
+ function showParametersAreaIfNecessary(params) {
377
+ parametersAreaNecessary = hasVisibleParameters(params) || !controller.isReportAutoRun();
378
+ showParametersArea(parametersAreaNecessary);
379
+ }
379
380
  function updateParameters(successAction) {
380
381
  acceptParameters(controller.loadParameters(recentParameterValues), successAction);
381
382
  }
@@ -445,6 +446,9 @@ function ParametersArea(placeholder, options, otherOptions) {
445
446
  controller.reloadParameters(onReloadParameters).beforeLoadReport(function() {
446
447
  loadingCount = 0;
447
448
  beginLoad();
449
+ }).reportLoadComplete(function() {
450
+ showParametersAreaIfNecessary(parameters$1);
451
+ showPreviewButton();
448
452
  }).error(endLoad).pageReady(endLoad);
449
453
  controller.getParametersAreaState(function(event, args) {
450
454
  var parametersAreaNecessary2 = false;
@@ -88,7 +88,7 @@ function ReportViewer(dom, options) {
88
88
  if (!validateOptions(options)) {
89
89
  return;
90
90
  }
91
- var version = "18.2.24.806";
91
+ var version = "18.3.24.1112";
92
92
  options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
93
93
  settings = new reportViewerSettings.ReportViewerSettings(
94
94
  persistanceKey,
@@ -145,13 +145,13 @@ function ReportViewer(dom, options) {
145
145
  if (arguments.length === 0) {
146
146
  ignoreCache = true;
147
147
  }
148
- controller$1.refreshReport(ignoreCache);
148
+ controller$1.refreshReport(ignoreCache, true);
149
149
  return viewer;
150
150
  },
151
151
  reportSource: function(rs) {
152
152
  if (rs || rs === null) {
153
153
  controller$1.setReportSource(rs);
154
- controller$1.refreshReport(false);
154
+ controller$1.refreshReport(false, true);
155
155
  return viewer;
156
156
  }
157
157
  return controller$1.getReportSource();
@@ -204,6 +204,9 @@ function ReportViewer(dom, options) {
204
204
  getReportParameters: function() {
205
205
  return controller$1.getReportParameters();
206
206
  },
207
+ isReportAutoRun: function() {
208
+ return controller$1.isReportAutoRun();
209
+ },
207
210
  authenticationToken: function(token) {
208
211
  if (token) {
209
212
  controller$1.setAuthenticationToken(token);
@@ -279,7 +282,8 @@ function ReportViewer(dom, options) {
279
282
  INTERACTIVE_ACTION_LEAVE: controller$1.Events.INTERACTIVE_ACTION_LEAVE,
280
283
  VIEWER_TOOLTIP_OPENING: controller$1.Events.TOOLTIP_OPENING,
281
284
  SEND_EMAIL_BEGIN: controller$1.Events.SEND_EMAIL_STARTED,
282
- SEND_EMAIL_END: controller$1.Events.SEND_EMAIL_READY
285
+ SEND_EMAIL_END: controller$1.Events.SEND_EMAIL_READY,
286
+ PARAMETERS_LOADED: controller$1.Events.PARAMETERS_LOADED
283
287
  };
284
288
  var $viewer = $(viewer);
285
289
  for (const [viewerEvent, controllerEvent] of Object.entries(eventMap)) {
@@ -304,6 +308,7 @@ function ReportViewer(dom, options) {
304
308
  eventBinder(events.Events.VIEWER_TOOLTIP_OPENING, options.viewerToolTipOpening, true);
305
309
  eventBinder(events.Events.SEND_EMAIL_BEGIN, options.sendEmailBegin, true);
306
310
  eventBinder(events.Events.SEND_EMAIL_END, options.sendEmailEnd, true);
311
+ eventBinder(events.Events.PARAMETERS_LOADED, options.parametersLoaded, true);
307
312
  }
308
313
  function init() {
309
314
  $placeholder.html(templates["trv-report-viewer"]);
@@ -529,7 +534,7 @@ function ReportViewer(dom, options) {
529
534
  options.ready.call(viewer);
530
535
  }
531
536
  if (pendingRefresh) {
532
- controller$1.refreshReport(false);
537
+ controller$1.refreshReport(false, true);
533
538
  }
534
539
  }
535
540
  function loadStyleSheets(styleSheets) {
@@ -28,6 +28,7 @@ function ServiceClientSentinel(serviceClient, clientID, sessionTimeoutSeconds) {
28
28
  if (pingMilliseconds <= 0) {
29
29
  return;
30
30
  }
31
+ pingMilliseconds = Math.min(pingMilliseconds, 2147483647);
31
32
  interval = setInterval(function() {
32
33
  serviceClient.keepClientAlive(clientID);
33
34
  }, pingMilliseconds);
package/dist/cjs/sr.js CHANGED
@@ -15,6 +15,8 @@ var sr = {
15
15
  cannotValidateType: "Cannot validate parameter of type {type}.",
16
16
  loadingFormats: "Loading...",
17
17
  loadingReport: "Loading report...",
18
+ loadingParameters: "Loading parameters...",
19
+ autoRunDisabled: "Please validate the report parameter values and press Preview to generate the report.",
18
20
  preparingDownload: "Preparing document to download. Please wait...",
19
21
  preparingPrint: "Preparing document to print. Please wait...",
20
22
  errorLoadingTemplates: "Error loading the report viewer's templates. (templateUrl = '{0}').",
@@ -67,8 +67,8 @@ function Accessibility(options) {
67
67
  }
68
68
  function setPageSelector() {
69
69
  var pagers = document.querySelectorAll(".trv-report-pager");
70
- var pageNumber = this._controller.getCurrentPageNumber();
71
- var pageCount = this._controller.getPageCount();
70
+ var pageNumber = controller.getCurrentPageNumber();
71
+ var pageCount = controller.getPageCount();
72
72
  pagers.forEach((pager) => {
73
73
  pager.setAttribute("aria-label", stringFormat(stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
74
74
  var pageInputs = pager.querySelectorAll("input[data-role=telerik_ReportViewer_PageNumberInput]");
@@ -76,7 +76,7 @@ function CommandSet(options) {
76
76
  }),
77
77
  "refresh": new Command(
78
78
  function() {
79
- controller.refreshReport(true);
79
+ controller.refreshReport(true, false);
80
80
  }
81
81
  ),
82
82
  "export": new Command(function(format) {
@@ -614,7 +614,7 @@ function ReportViewerController(options) {
614
614
  report: args.Report,
615
615
  parameters: fixDataContractJsonSerializer(args.ParameterValues)
616
616
  });
617
- controller.refreshReport(false);
617
+ controller.refreshReport(false, true);
618
618
  },
619
619
  "navigateToUrl": function(action) {
620
620
  var args = action.Value;
@@ -726,6 +726,7 @@ function ReportViewerController(options) {
726
726
  UPDATE_UI: "trv.UPDATE_UI",
727
727
  CSS_LOADED: "cssLoaded",
728
728
  RELOAD_PARAMETERS: "reloadParameters",
729
+ PARAMETERS_LOADED: "parametersLoaded",
729
730
  INTERACTIVE_ACTION_EXECUTING: "interactiveActionExecuting",
730
731
  INTERACTIVE_ACTION_ENTER: "interactiveActionEnter",
731
732
  INTERACTIVE_ACTION_LEAVE: "interactiveActionLeave",
@@ -775,7 +776,7 @@ function ReportViewerController(options) {
775
776
  return this;
776
777
  }
777
778
  report = rs.report;
778
- parameterValues = rs.parameters;
779
+ controller.setParameters(rs.parameters);
779
780
  changeReportSource(rs);
780
781
  return this;
781
782
  },
@@ -796,6 +797,7 @@ function ReportViewerController(options) {
796
797
  },
797
798
  setParameters: function(paramValues) {
798
799
  parameterValues = paramValues;
800
+ controller.parametersLoaded();
799
801
  },
800
802
  setProcessedParameter: function(processedParamValues) {
801
803
  processedParameterValues = processedParamValues;
@@ -873,6 +875,7 @@ function ReportViewerController(options) {
873
875
  },
874
876
  previewReport: function(ignoreCache, baseDocumentId, actionId) {
875
877
  controller.loadedReportChange();
878
+ controller.respectReportAutoRun = false;
876
879
  controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
877
880
  },
878
881
  refreshReportCore: function(ignoreCache, baseDocumentId, actionId) {
@@ -910,7 +913,7 @@ function ReportViewerController(options) {
910
913
  }
911
914
  return paramsToBeExposed;
912
915
  },
913
- refreshReport: function(ignoreCache, baseDocumentId, actionId) {
916
+ refreshReport: function(ignoreCache, respectAutoRun, baseDocumentId, actionId) {
914
917
  controller.loadedReportChange();
915
918
  if (clientHasExpired) {
916
919
  clientHasExpired = false;
@@ -940,12 +943,25 @@ function ReportViewerController(options) {
940
943
  appendInvalidReportParameterNames(invalidParameters);
941
944
  controller.missingOrInvalidParameters();
942
945
  } else {
946
+ controller.respectReportAutoRun = respectAutoRun;
943
947
  controller.setParameters(parameterValues2);
944
- controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
948
+ if (controller.isReportAutoRun()) {
949
+ controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
950
+ } else {
951
+ controller.showNotification({ stringResources: "autoRunDisabled" });
952
+ }
945
953
  }
946
954
  });
947
955
  controller.reloadParameters(loadParametersPromise);
948
956
  },
957
+ isReportAutoRun: function() {
958
+ var _a;
959
+ var reportAutoRunParameter = true;
960
+ if (parameterValues) {
961
+ reportAutoRunParameter = (_a = parameterValues.trv_AutoRun) != null ? _a : true;
962
+ }
963
+ return !controller.respectReportAutoRun || reportAutoRunParameter;
964
+ },
949
965
  exportReport: function(format, deviceInfo) {
950
966
  exportReport(format, deviceInfo);
951
967
  },
@@ -1027,6 +1043,9 @@ function ReportViewerController(options) {
1027
1043
  reloadParameters: function(...args) {
1028
1044
  return eventFactory(controller.Events.RELOAD_PARAMETERS, args);
1029
1045
  },
1046
+ parametersLoaded: function(...args) {
1047
+ return eventFactory(controller.Events.PARAMETERS_LOADED, args);
1048
+ },
1030
1049
  exportStarted: function(...args) {
1031
1050
  return eventFactory(controller.Events.EXPORT_STARTED, args);
1032
1051
  },
@@ -45,6 +45,16 @@ function DocumentMapArea(placeholder, options, otherOptions) {
45
45
  $li.attr("aria-label", $li[0].innerText);
46
46
  });
47
47
  }
48
+ function resetReportAndClearItems() {
49
+ documentMapNecessary = false;
50
+ showDocumentMap(false);
51
+ var r = controller.getReportSource().report;
52
+ var clearMapItems = currentReport !== r || !isVisible();
53
+ currentReport = r;
54
+ if (clearMapItems) {
55
+ clearDocumentMap();
56
+ }
57
+ }
48
58
  function clearDocumentMap() {
49
59
  displayDocumentMap([]);
50
60
  }
@@ -110,14 +120,10 @@ function DocumentMapArea(placeholder, options, otherOptions) {
110
120
  }
111
121
  }
112
122
  function attach() {
113
- controller.beginLoadReport(function() {
123
+ controller.beforeLoadParameters(function() {
124
+ resetReportAndClearItems();
125
+ }).beginLoadReport(function() {
114
126
  beginLoad();
115
- var r = controller.getReportSource().report;
116
- var clearMapItems = currentReport !== r || !isVisible();
117
- currentReport = r;
118
- if (clearMapItems) {
119
- clearDocumentMap();
120
- }
121
127
  }).reportLoadComplete(function(event, args) {
122
128
  if (args.documentMapAvailable) {
123
129
  documentMapNecessary = true;
package/dist/es/events.js CHANGED
@@ -13,7 +13,8 @@ const Events = {
13
13
  INTERACTIVE_ACTION_LEAVE: "INTERACTIVE_ACTION_LEAVE",
14
14
  VIEWER_TOOLTIP_OPENING: "VIEWER_TOOLTIP_OPENING",
15
15
  SEND_EMAIL_BEGIN: "SEND_EMAIL_BEGIN",
16
- SEND_EMAIL_END: "SEND_EMAIL_END"
16
+ SEND_EMAIL_END: "SEND_EMAIL_END",
17
+ PARAMETERS_LOADED: "PARAMETERS_LOADED"
17
18
  };
18
19
 
19
20
  export { Events };
@@ -59,11 +59,11 @@ function HistoryManager(options) {
59
59
  });
60
60
  }
61
61
  }
62
- function exec(currentRecord) {
62
+ function exec(currentRecord, reportChanged) {
63
63
  controller.setReportDocumentId(currentRecord.reportDocumentId);
64
64
  controller.setViewMode(currentRecord.viewMode);
65
65
  controller.setReportSource(currentRecord.reportSource);
66
- controller.refreshReport(false, currentRecord.reportDocumentId);
66
+ controller.refreshReport(false, reportChanged, currentRecord.reportDocumentId);
67
67
  controller.navigateToPage(currentRecord.pageNumber);
68
68
  }
69
69
  function canMove(step) {
@@ -82,9 +82,13 @@ function HistoryManager(options) {
82
82
  newPos = length - 1;
83
83
  }
84
84
  if (newPos != position) {
85
+ var currentRecord = getCurrentRecord();
86
+ var currentReport = currentRecord.reportSource ? currentRecord.reportSource.report : "";
85
87
  history.position = newPos;
86
88
  saveSettings();
87
- exec(getCurrentRecord());
89
+ var newRecord = getCurrentRecord();
90
+ var newReport = newRecord.reportSource ? newRecord.reportSource.report : "";
91
+ exec(newRecord, currentReport !== newReport);
88
92
  }
89
93
  }
90
94
  function removeTempRecordsFromHistory() {
@@ -117,7 +121,7 @@ function HistoryManager(options) {
117
121
  loadCurrent: function() {
118
122
  var rec = getCurrentRecord();
119
123
  if (rec) {
120
- exec(rec);
124
+ exec(rec, false);
121
125
  }
122
126
  return Boolean(rec);
123
127
  }
@@ -91,7 +91,8 @@ function PagesArea(placeholder, options, otherOptions) {
91
91
  documentReady = false;
92
92
  }).beforeLoadParameters(function(event, initial) {
93
93
  if (initial) {
94
- showError(stringResources.loadingReport);
94
+ clearPendingTimeoutIds();
95
+ showError(stringResources.loadingParameters);
95
96
  }
96
97
  }).beforeLoadReport(function() {
97
98
  documentReady = false;
@@ -101,7 +102,9 @@ function PagesArea(placeholder, options, otherOptions) {
101
102
  clearPendingTimeoutIds();
102
103
  clear();
103
104
  disablePagesArea(true);
104
- showError(stringResources.loadingReport);
105
+ if (controller.isReportAutoRun()) {
106
+ showError(stringResources.loadingReport);
107
+ }
105
108
  }).beginLoadReport(function(event, args) {
106
109
  documentReady = true;
107
110
  invalidateCurrentlyLoadedPage();
@@ -166,7 +166,7 @@ function ParametersArea(placeholder, options, otherOptions) {
166
166
  (error ? $.fn.addClass : $.fn.removeClass).call($placeholder, "trv-error");
167
167
  }
168
168
  function showPreviewButton() {
169
- (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
169
+ (allParametersAutoRefresh() && controller.isReportAutoRun() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
170
170
  }
171
171
  function allParametersAutoRefresh() {
172
172
  var allAuto = Array.from(parameters).every((parameter) => {
@@ -354,10 +354,7 @@ function ParametersArea(placeholder, options, otherOptions) {
354
354
  }
355
355
  var parametersAreaNecessary = false;
356
356
  function onLoadParametersComplete(params, successAction) {
357
- parametersAreaNecessary = hasVisibleParameters(params);
358
- if (!parametersAreaNecessary) {
359
- showParametersArea(false);
360
- }
357
+ showParametersAreaIfNecessary(params);
361
358
  fill(params);
362
359
  showError("");
363
360
  if (parametersAreaNecessary && parametersAreaVisible) {
@@ -372,6 +369,10 @@ function ParametersArea(placeholder, options, otherOptions) {
372
369
  }
373
370
  endLoad();
374
371
  }
372
+ function showParametersAreaIfNecessary(params) {
373
+ parametersAreaNecessary = hasVisibleParameters(params) || !controller.isReportAutoRun();
374
+ showParametersArea(parametersAreaNecessary);
375
+ }
375
376
  function updateParameters(successAction) {
376
377
  acceptParameters(controller.loadParameters(recentParameterValues), successAction);
377
378
  }
@@ -441,6 +442,9 @@ function ParametersArea(placeholder, options, otherOptions) {
441
442
  controller.reloadParameters(onReloadParameters).beforeLoadReport(function() {
442
443
  loadingCount = 0;
443
444
  beginLoad();
445
+ }).reportLoadComplete(function() {
446
+ showParametersAreaIfNecessary(parameters);
447
+ showPreviewButton();
444
448
  }).error(endLoad).pageReady(endLoad);
445
449
  controller.getParametersAreaState(function(event, args) {
446
450
  var parametersAreaNecessary2 = false;
@@ -84,7 +84,7 @@ function ReportViewer(dom, options) {
84
84
  if (!validateOptions(options)) {
85
85
  return;
86
86
  }
87
- var version = "18.2.24.806";
87
+ var version = "18.3.24.1112";
88
88
  options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
89
89
  settings = new ReportViewerSettings(
90
90
  persistanceKey,
@@ -141,13 +141,13 @@ function ReportViewer(dom, options) {
141
141
  if (arguments.length === 0) {
142
142
  ignoreCache = true;
143
143
  }
144
- controller.refreshReport(ignoreCache);
144
+ controller.refreshReport(ignoreCache, true);
145
145
  return viewer;
146
146
  },
147
147
  reportSource: function(rs) {
148
148
  if (rs || rs === null) {
149
149
  controller.setReportSource(rs);
150
- controller.refreshReport(false);
150
+ controller.refreshReport(false, true);
151
151
  return viewer;
152
152
  }
153
153
  return controller.getReportSource();
@@ -200,6 +200,9 @@ function ReportViewer(dom, options) {
200
200
  getReportParameters: function() {
201
201
  return controller.getReportParameters();
202
202
  },
203
+ isReportAutoRun: function() {
204
+ return controller.isReportAutoRun();
205
+ },
203
206
  authenticationToken: function(token) {
204
207
  if (token) {
205
208
  controller.setAuthenticationToken(token);
@@ -275,7 +278,8 @@ function ReportViewer(dom, options) {
275
278
  INTERACTIVE_ACTION_LEAVE: controller.Events.INTERACTIVE_ACTION_LEAVE,
276
279
  VIEWER_TOOLTIP_OPENING: controller.Events.TOOLTIP_OPENING,
277
280
  SEND_EMAIL_BEGIN: controller.Events.SEND_EMAIL_STARTED,
278
- SEND_EMAIL_END: controller.Events.SEND_EMAIL_READY
281
+ SEND_EMAIL_END: controller.Events.SEND_EMAIL_READY,
282
+ PARAMETERS_LOADED: controller.Events.PARAMETERS_LOADED
279
283
  };
280
284
  var $viewer = $(viewer);
281
285
  for (const [viewerEvent, controllerEvent] of Object.entries(eventMap)) {
@@ -300,6 +304,7 @@ function ReportViewer(dom, options) {
300
304
  eventBinder(Events.VIEWER_TOOLTIP_OPENING, options.viewerToolTipOpening, true);
301
305
  eventBinder(Events.SEND_EMAIL_BEGIN, options.sendEmailBegin, true);
302
306
  eventBinder(Events.SEND_EMAIL_END, options.sendEmailEnd, true);
307
+ eventBinder(Events.PARAMETERS_LOADED, options.parametersLoaded, true);
303
308
  }
304
309
  function init() {
305
310
  $placeholder.html(templates["trv-report-viewer"]);
@@ -525,7 +530,7 @@ function ReportViewer(dom, options) {
525
530
  options.ready.call(viewer);
526
531
  }
527
532
  if (pendingRefresh) {
528
- controller.refreshReport(false);
533
+ controller.refreshReport(false, true);
529
534
  }
530
535
  }
531
536
  function loadStyleSheets(styleSheets) {