@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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * TelerikReporting v18.2.24.806 (https://www.telerik.com/products/reporting.aspx)
2
+ * TelerikReporting v18.3.24.1112 (https://www.telerik.com/products/reporting.aspx)
3
3
  * Copyright 2024 Progress Software EAD. All rights reserved.
4
4
  *
5
5
  * Telerik Reporting commercial licenses may be obtained at
@@ -561,6 +561,8 @@ var telerikReportViewer = (function (exports) {
561
561
  cannotValidateType: "Cannot validate parameter of type {type}.",
562
562
  loadingFormats: "Loading...",
563
563
  loadingReport: "Loading report...",
564
+ loadingParameters: "Loading parameters...",
565
+ autoRunDisabled: "Please validate the report parameter values and press Preview to generate the report.",
564
566
  preparingDownload: "Preparing document to download. Please wait...",
565
567
  preparingPrint: "Preparing document to print. Please wait...",
566
568
  errorLoadingTemplates: "Error loading the report viewer's templates. (templateUrl = '{0}').",
@@ -779,8 +781,8 @@ var telerikReportViewer = (function (exports) {
779
781
  }
780
782
  function setPageSelector() {
781
783
  var pagers = document.querySelectorAll(".trv-report-pager");
782
- var pageNumber = this._controller.getCurrentPageNumber();
783
- var pageCount = this._controller.getPageCount();
784
+ var pageNumber = controller.getCurrentPageNumber();
785
+ var pageCount = controller.getPageCount();
784
786
  pagers.forEach((pager) => {
785
787
  pager.setAttribute("aria-label", stringFormat(stringResources.ariaLabelPageNumberSelector, [pageNumber, pageCount]));
786
788
  var pageInputs = pager.querySelectorAll("input[data-role=telerik_ReportViewer_PageNumberInput]");
@@ -1131,7 +1133,7 @@ var telerikReportViewer = (function (exports) {
1131
1133
  }),
1132
1134
  "refresh": new Command(
1133
1135
  function() {
1134
- controller.refreshReport(true);
1136
+ controller.refreshReport(true, false);
1135
1137
  }
1136
1138
  ),
1137
1139
  "export": new Command(function(format) {
@@ -1552,6 +1554,7 @@ var telerikReportViewer = (function (exports) {
1552
1554
  if (pingMilliseconds <= 0) {
1553
1555
  return;
1554
1556
  }
1557
+ pingMilliseconds = Math.min(pingMilliseconds, 2147483647);
1555
1558
  interval = setInterval(function() {
1556
1559
  serviceClient.keepClientAlive(clientID);
1557
1560
  }, pingMilliseconds);
@@ -2307,7 +2310,7 @@ var telerikReportViewer = (function (exports) {
2307
2310
  report: args.Report,
2308
2311
  parameters: fixDataContractJsonSerializer(args.ParameterValues)
2309
2312
  });
2310
- controller.refreshReport(false);
2313
+ controller.refreshReport(false, true);
2311
2314
  },
2312
2315
  "navigateToUrl": function(action) {
2313
2316
  var args = action.Value;
@@ -2419,6 +2422,7 @@ var telerikReportViewer = (function (exports) {
2419
2422
  UPDATE_UI: "trv.UPDATE_UI",
2420
2423
  CSS_LOADED: "cssLoaded",
2421
2424
  RELOAD_PARAMETERS: "reloadParameters",
2425
+ PARAMETERS_LOADED: "parametersLoaded",
2422
2426
  INTERACTIVE_ACTION_EXECUTING: "interactiveActionExecuting",
2423
2427
  INTERACTIVE_ACTION_ENTER: "interactiveActionEnter",
2424
2428
  INTERACTIVE_ACTION_LEAVE: "interactiveActionLeave",
@@ -2468,7 +2472,7 @@ var telerikReportViewer = (function (exports) {
2468
2472
  return this;
2469
2473
  }
2470
2474
  report = rs.report;
2471
- parameterValues = rs.parameters;
2475
+ controller.setParameters(rs.parameters);
2472
2476
  changeReportSource(rs);
2473
2477
  return this;
2474
2478
  },
@@ -2489,6 +2493,7 @@ var telerikReportViewer = (function (exports) {
2489
2493
  },
2490
2494
  setParameters: function(paramValues) {
2491
2495
  parameterValues = paramValues;
2496
+ controller.parametersLoaded();
2492
2497
  },
2493
2498
  setProcessedParameter: function(processedParamValues) {
2494
2499
  processedParameterValues = processedParamValues;
@@ -2566,6 +2571,7 @@ var telerikReportViewer = (function (exports) {
2566
2571
  },
2567
2572
  previewReport: function(ignoreCache, baseDocumentId, actionId) {
2568
2573
  controller.loadedReportChange();
2574
+ controller.respectReportAutoRun = false;
2569
2575
  controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
2570
2576
  },
2571
2577
  refreshReportCore: function(ignoreCache, baseDocumentId, actionId) {
@@ -2603,7 +2609,7 @@ var telerikReportViewer = (function (exports) {
2603
2609
  }
2604
2610
  return paramsToBeExposed;
2605
2611
  },
2606
- refreshReport: function(ignoreCache, baseDocumentId, actionId) {
2612
+ refreshReport: function(ignoreCache, respectAutoRun, baseDocumentId, actionId) {
2607
2613
  controller.loadedReportChange();
2608
2614
  if (clientHasExpired) {
2609
2615
  clientHasExpired = false;
@@ -2633,12 +2639,25 @@ var telerikReportViewer = (function (exports) {
2633
2639
  appendInvalidReportParameterNames(invalidParameters);
2634
2640
  controller.missingOrInvalidParameters();
2635
2641
  } else {
2642
+ controller.respectReportAutoRun = respectAutoRun;
2636
2643
  controller.setParameters(parameterValues2);
2637
- controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
2644
+ if (controller.isReportAutoRun()) {
2645
+ controller.refreshReportCore(ignoreCache, baseDocumentId, actionId);
2646
+ } else {
2647
+ controller.showNotification({ stringResources: "autoRunDisabled" });
2648
+ }
2638
2649
  }
2639
2650
  });
2640
2651
  controller.reloadParameters(loadParametersPromise);
2641
2652
  },
2653
+ isReportAutoRun: function() {
2654
+ var _a;
2655
+ var reportAutoRunParameter = true;
2656
+ if (parameterValues) {
2657
+ reportAutoRunParameter = (_a = parameterValues.trv_AutoRun) != null ? _a : true;
2658
+ }
2659
+ return !controller.respectReportAutoRun || reportAutoRunParameter;
2660
+ },
2642
2661
  exportReport: function(format, deviceInfo) {
2643
2662
  exportReport(format, deviceInfo);
2644
2663
  },
@@ -2720,6 +2739,9 @@ var telerikReportViewer = (function (exports) {
2720
2739
  reloadParameters: function(...args) {
2721
2740
  return eventFactory(controller.Events.RELOAD_PARAMETERS, args);
2722
2741
  },
2742
+ parametersLoaded: function(...args) {
2743
+ return eventFactory(controller.Events.PARAMETERS_LOADED, args);
2744
+ },
2723
2745
  exportStarted: function(...args) {
2724
2746
  return eventFactory(controller.Events.EXPORT_STARTED, args);
2725
2747
  },
@@ -2908,7 +2930,8 @@ var telerikReportViewer = (function (exports) {
2908
2930
  INTERACTIVE_ACTION_LEAVE: "INTERACTIVE_ACTION_LEAVE",
2909
2931
  VIEWER_TOOLTIP_OPENING: "VIEWER_TOOLTIP_OPENING",
2910
2932
  SEND_EMAIL_BEGIN: "SEND_EMAIL_BEGIN",
2911
- SEND_EMAIL_END: "SEND_EMAIL_END"
2933
+ SEND_EMAIL_END: "SEND_EMAIL_END",
2934
+ PARAMETERS_LOADED: "PARAMETERS_LOADED"
2912
2935
  };
2913
2936
 
2914
2937
  function HistoryManager(options) {
@@ -2970,11 +2993,11 @@ var telerikReportViewer = (function (exports) {
2970
2993
  });
2971
2994
  }
2972
2995
  }
2973
- function exec(currentRecord) {
2996
+ function exec(currentRecord, reportChanged) {
2974
2997
  controller.setReportDocumentId(currentRecord.reportDocumentId);
2975
2998
  controller.setViewMode(currentRecord.viewMode);
2976
2999
  controller.setReportSource(currentRecord.reportSource);
2977
- controller.refreshReport(false, currentRecord.reportDocumentId);
3000
+ controller.refreshReport(false, reportChanged, currentRecord.reportDocumentId);
2978
3001
  controller.navigateToPage(currentRecord.pageNumber);
2979
3002
  }
2980
3003
  function canMove(step) {
@@ -2993,9 +3016,13 @@ var telerikReportViewer = (function (exports) {
2993
3016
  newPos = length - 1;
2994
3017
  }
2995
3018
  if (newPos != position) {
3019
+ var currentRecord = getCurrentRecord();
3020
+ var currentReport = currentRecord.reportSource ? currentRecord.reportSource.report : "";
2996
3021
  history.position = newPos;
2997
3022
  saveSettings();
2998
- exec(getCurrentRecord());
3023
+ var newRecord = getCurrentRecord();
3024
+ var newReport = newRecord.reportSource ? newRecord.reportSource.report : "";
3025
+ exec(newRecord, currentReport !== newReport);
2999
3026
  }
3000
3027
  }
3001
3028
  function removeTempRecordsFromHistory() {
@@ -3028,7 +3055,7 @@ var telerikReportViewer = (function (exports) {
3028
3055
  loadCurrent: function() {
3029
3056
  var rec = getCurrentRecord();
3030
3057
  if (rec) {
3031
- exec(rec);
3058
+ exec(rec, false);
3032
3059
  }
3033
3060
  return Boolean(rec);
3034
3061
  }
@@ -4004,7 +4031,8 @@ var telerikReportViewer = (function (exports) {
4004
4031
  documentReady = false;
4005
4032
  }).beforeLoadParameters(function(event, initial) {
4006
4033
  if (initial) {
4007
- showError(stringResources.loadingReport);
4034
+ clearPendingTimeoutIds();
4035
+ showError(stringResources.loadingParameters);
4008
4036
  }
4009
4037
  }).beforeLoadReport(function() {
4010
4038
  documentReady = false;
@@ -4014,7 +4042,9 @@ var telerikReportViewer = (function (exports) {
4014
4042
  clearPendingTimeoutIds();
4015
4043
  clear();
4016
4044
  disablePagesArea(true);
4017
- showError(stringResources.loadingReport);
4045
+ if (controller.isReportAutoRun()) {
4046
+ showError(stringResources.loadingReport);
4047
+ }
4018
4048
  }).beginLoadReport(function(event, args) {
4019
4049
  documentReady = true;
4020
4050
  invalidateCurrentlyLoadedPage();
@@ -6054,6 +6084,16 @@ var telerikReportViewer = (function (exports) {
6054
6084
  $li.attr("aria-label", $li[0].innerText);
6055
6085
  });
6056
6086
  }
6087
+ function resetReportAndClearItems() {
6088
+ documentMapNecessary = false;
6089
+ showDocumentMap(false);
6090
+ var r = controller.getReportSource().report;
6091
+ var clearMapItems = currentReport !== r || !isVisible();
6092
+ currentReport = r;
6093
+ if (clearMapItems) {
6094
+ clearDocumentMap();
6095
+ }
6096
+ }
6057
6097
  function clearDocumentMap() {
6058
6098
  displayDocumentMap([]);
6059
6099
  }
@@ -6119,14 +6159,10 @@ var telerikReportViewer = (function (exports) {
6119
6159
  }
6120
6160
  }
6121
6161
  function attach() {
6122
- controller.beginLoadReport(function() {
6162
+ controller.beforeLoadParameters(function() {
6163
+ resetReportAndClearItems();
6164
+ }).beginLoadReport(function() {
6123
6165
  beginLoad();
6124
- var r = controller.getReportSource().report;
6125
- var clearMapItems = currentReport !== r || !isVisible();
6126
- currentReport = r;
6127
- if (clearMapItems) {
6128
- clearDocumentMap();
6129
- }
6130
6166
  }).reportLoadComplete(function(event, args) {
6131
6167
  if (args.documentMapAvailable) {
6132
6168
  documentMapNecessary = true;
@@ -6322,7 +6358,7 @@ var telerikReportViewer = (function (exports) {
6322
6358
  (error ? $.fn.addClass : $.fn.removeClass).call($placeholder, "trv-error");
6323
6359
  }
6324
6360
  function showPreviewButton() {
6325
- (allParametersAutoRefresh() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
6361
+ (allParametersAutoRefresh() && controller.isReportAutoRun() ? $.fn.removeClass : $.fn.addClass).call($placeholder, "preview");
6326
6362
  }
6327
6363
  function allParametersAutoRefresh() {
6328
6364
  var allAuto = Array.from(parameters).every((parameter) => {
@@ -6510,10 +6546,7 @@ var telerikReportViewer = (function (exports) {
6510
6546
  }
6511
6547
  var parametersAreaNecessary = false;
6512
6548
  function onLoadParametersComplete(params, successAction) {
6513
- parametersAreaNecessary = hasVisibleParameters(params);
6514
- if (!parametersAreaNecessary) {
6515
- showParametersArea(false);
6516
- }
6549
+ showParametersAreaIfNecessary(params);
6517
6550
  fill(params);
6518
6551
  showError("");
6519
6552
  if (parametersAreaNecessary && parametersAreaVisible) {
@@ -6528,6 +6561,10 @@ var telerikReportViewer = (function (exports) {
6528
6561
  }
6529
6562
  endLoad();
6530
6563
  }
6564
+ function showParametersAreaIfNecessary(params) {
6565
+ parametersAreaNecessary = hasVisibleParameters(params) || !controller.isReportAutoRun();
6566
+ showParametersArea(parametersAreaNecessary);
6567
+ }
6531
6568
  function updateParameters(successAction) {
6532
6569
  acceptParameters(controller.loadParameters(recentParameterValues), successAction);
6533
6570
  }
@@ -6597,6 +6634,9 @@ var telerikReportViewer = (function (exports) {
6597
6634
  controller.reloadParameters(onReloadParameters).beforeLoadReport(function() {
6598
6635
  loadingCount = 0;
6599
6636
  beginLoad();
6637
+ }).reportLoadComplete(function() {
6638
+ showParametersAreaIfNecessary(parameters);
6639
+ showPreviewButton();
6600
6640
  }).error(endLoad).pageReady(endLoad);
6601
6641
  controller.getParametersAreaState(function(event, args) {
6602
6642
  var parametersAreaNecessary2 = false;
@@ -8503,7 +8543,7 @@ var telerikReportViewer = (function (exports) {
8503
8543
  if (!validateOptions(options)) {
8504
8544
  return;
8505
8545
  }
8506
- var version = "18.2.24.806";
8546
+ var version = "18.3.24.1112";
8507
8547
  options = $.extend({}, getDefaultOptions(svcApiUrl, version), options);
8508
8548
  settings = new ReportViewerSettings(
8509
8549
  persistanceKey,
@@ -8560,13 +8600,13 @@ var telerikReportViewer = (function (exports) {
8560
8600
  if (arguments.length === 0) {
8561
8601
  ignoreCache = true;
8562
8602
  }
8563
- controller.refreshReport(ignoreCache);
8603
+ controller.refreshReport(ignoreCache, true);
8564
8604
  return viewer;
8565
8605
  },
8566
8606
  reportSource: function(rs) {
8567
8607
  if (rs || rs === null) {
8568
8608
  controller.setReportSource(rs);
8569
- controller.refreshReport(false);
8609
+ controller.refreshReport(false, true);
8570
8610
  return viewer;
8571
8611
  }
8572
8612
  return controller.getReportSource();
@@ -8619,6 +8659,9 @@ var telerikReportViewer = (function (exports) {
8619
8659
  getReportParameters: function() {
8620
8660
  return controller.getReportParameters();
8621
8661
  },
8662
+ isReportAutoRun: function() {
8663
+ return controller.isReportAutoRun();
8664
+ },
8622
8665
  authenticationToken: function(token) {
8623
8666
  if (token) {
8624
8667
  controller.setAuthenticationToken(token);
@@ -8694,7 +8737,8 @@ var telerikReportViewer = (function (exports) {
8694
8737
  INTERACTIVE_ACTION_LEAVE: controller.Events.INTERACTIVE_ACTION_LEAVE,
8695
8738
  VIEWER_TOOLTIP_OPENING: controller.Events.TOOLTIP_OPENING,
8696
8739
  SEND_EMAIL_BEGIN: controller.Events.SEND_EMAIL_STARTED,
8697
- SEND_EMAIL_END: controller.Events.SEND_EMAIL_READY
8740
+ SEND_EMAIL_END: controller.Events.SEND_EMAIL_READY,
8741
+ PARAMETERS_LOADED: controller.Events.PARAMETERS_LOADED
8698
8742
  };
8699
8743
  var $viewer = $(viewer);
8700
8744
  for (const [viewerEvent, controllerEvent] of Object.entries(eventMap)) {
@@ -8719,6 +8763,7 @@ var telerikReportViewer = (function (exports) {
8719
8763
  eventBinder(Events$1.VIEWER_TOOLTIP_OPENING, options.viewerToolTipOpening, true);
8720
8764
  eventBinder(Events$1.SEND_EMAIL_BEGIN, options.sendEmailBegin, true);
8721
8765
  eventBinder(Events$1.SEND_EMAIL_END, options.sendEmailEnd, true);
8766
+ eventBinder(Events$1.PARAMETERS_LOADED, options.parametersLoaded, true);
8722
8767
  }
8723
8768
  function init() {
8724
8769
  $placeholder.html(templates["trv-report-viewer"]);
@@ -8944,7 +8989,7 @@ var telerikReportViewer = (function (exports) {
8944
8989
  options.ready.call(viewer);
8945
8990
  }
8946
8991
  if (pendingRefresh) {
8947
- controller.refreshReport(false);
8992
+ controller.refreshReport(false, true);
8948
8993
  }
8949
8994
  }
8950
8995
  function loadStyleSheets(styleSheets) {