3 ChangeDetectionStrategy,
13 } from '@angular/core';
14 import { MatPaginator } from '@angular/material/paginator';
15 import { MatSort } from '@angular/material/sort';
16 import { MatTableDataSource } from '@angular/material/table';
17 import { ActivatedRoute, Router } from '@angular/router';
18 import { HttpClient } from '@angular/common/http';
19 import { RunService } from '../run.service';
20 import { GridsterConfig, GridsterItem, GridType } from 'angular-gridster2';
21 import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
22 import {environment} from '../../../../environments/environment';
23 import {DisplayHtml} from '../../../pages/analytics/Report_List/Report/display-html';
24 import {ErrorModalComponent} from '../../../modals/error-modal/error-modal.component';
25 import {InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
26 import { FormControl } from '@angular/forms';
27 import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
28 import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
29 import {MatDialog} from '@angular/material';
30 import {HttpCacheService} from '../../../shared/services/cache.service';
32 export interface PeriodicElement {
36 const ELEMENT_DATA: PeriodicElement[] = [{}];
39 selector: 'app-run-report',
40 templateUrl: './run-report.component.html',
41 styleUrls: ['./run-report.component.css'],
42 changeDetection: ChangeDetectionStrategy.OnPush
44 export class RunReportComponent implements OnInit, AfterViewInit, OnChanges {
45 @Input('reportId') inputReportId: string;
46 @Input('reportMode') reportMode: string;
47 @Input('queryString') queryString: string;
48 @Input('isGoBack') isGoBack: string;
49 @Input('DashboardReportObj') DashboardReportObj: Array<GridsterItem>;
50 @Input('TriggerFFArr') TriggerFFArr: string[];
51 @Input('hitCnt') hitCnt: number;
52 @Input('runAgain') runAgain: string;
53 @Input('groupSelectValue') groupSelectValue: string;
54 @Input('chartType') chartType: string;
55 @ViewChild('iframe') iframe: ElementRef;
56 @ViewChild(MatPaginator, {static: false} as any) paginator: MatPaginator;
57 @ViewChild(MatSort, {static: false} as any) sort: MatSort;
58 dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
59 displayedColumns: string[];
60 IncomingReportId: string;
61 displayedColumnsArr: string[];
62 displayedRowObj: PeriodicElement[];
63 formFieldPresent: boolean;
67 responseFormFieldListLength: number;
68 NEWdisplayedColumns: string[];
71 showDashboardReport: boolean;
73 options: GridsterConfig;
74 dashboard: Array<GridsterItem> = [];
75 openOptionsFlag: boolean;
76 showMoreVert: boolean;
81 initialQueryString: string;
83 runButtonHitCnt: number;
86 replaceDisplayValue: String;
95 download_in_progress: boolean;
96 commentCtrl = new FormControl('');
97 isChartAvailable = false;
100 showBackButton = false;
102 isDashboardExcelReadyToDownload = false;
104 constructor(private _http: HttpClient,
105 private _route: ActivatedRoute,
106 private _runService: RunService,
107 private _router: Router,
108 private changeDetectorRefs: ChangeDetectorRef,
109 public sanitizer: DomSanitizer,
110 public ngbModal: NgbModal,
111 private httpCacheService: HttpCacheService,
112 private dialog: MatDialog) {
113 this.displayedColumnsArr = [];
114 this.displayedRowObj = [];
115 this.displayedColumns = [];
116 this.formFieldList = [];
117 this.showSpinner = true;
118 this.isReady = false;
119 this.NEWdisplayedColumns = [];
122 this.showDashboardReport = false;
123 this.openOptionsFlag = false;
124 this.showMoreVert = false;
125 this.environment = environment;
126 this.initCounter = 0;
127 this.runButtonHitCnt = 0;
128 this.displayTotal = [];
129 this.totalRecords = 0;
131 this.download_in_progress = false;
133 this.isDashboardExcelReadyToDownload = false;
136 @HostListener('click') onClick() {
137 this.changeDetectorRefs.detectChanges();
140 ngOnChanges(changes: SimpleChanges) {
141 if (this.reportMode !== 'Regular' && this.initCnt > 0 && changes['runAgain']) {
143 this.showMoreVert = false;
144 if (changes['queryString']) {
145 this.queryString = changes['queryString']['currentValue'];
147 if (this.queryString !== this.initialQueryString) {
149 this.showDashboardReport = false;
150 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
151 this.displayedColumnsArr = [];
152 this.displayedRowObj = [];
153 this.displayedColumns = [];
154 this.formFieldList = [];
155 this.showSpinner = true;
156 this.isReady = false;
157 this.NEWdisplayedColumns = [];
158 this.displayTotal = [];
159 this.isChartAvailable = false;
160 this.timeTaken = '...';
161 const startDate: Date = new Date();
162 const startTime = startDate.getTime();
163 this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId, this.groupSelectValue)
164 .subscribe((response) => {
165 if (response['errormessage']) {
166 this.openErrorModel(response['errormessage']);
168 this.changeDetectorRefs.detectChanges();
170 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
171 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
172 if (this.reportMode !== 'FormField') {
173 this.postFetchingReportDataFn(response, false, 0);
174 const endDate: Date = new Date();
175 const endTime = endDate.getTime();
176 this.showMoreVert = true;
177 this.showDashboardReport = true;
178 this.errorMessage = '';
181 this.postFetchingReportDataFn(response, false, 0);
182 const endDate: Date = new Date();
183 const endTime = endDate.getTime();
184 this.showMoreVert = true;
185 this.errorMessage = '';
190 this.openErrorModel('Error occurred while running report: ' + this.inputReportId);
196 if (this.initialQueryString !== this.queryString && this.initCounter > 0 && this.hitCnt !== this.runButtonHitCnt) {
197 this.runButtonHitCnt = this.hitCnt;
198 this.initialQueryString = this.queryString;
199 this.initialProcesses();
201 this.runButtonHitCnt = this.hitCnt;
207 this.dataSource.paginator = this.paginator;
208 this.dataSource.sort = this.sort;
209 this.dataSource.data = this.displayedRowObj;
210 this.initialProcesses();
211 this.errorMessage = '';
216 if (this.DashboardReportObj.length > 0) {
217 this.dashboard = this.DashboardReportObj;
219 gridType: GridType.VerticalFixed,
223 outerMarginRight: 10,
224 outerMarginBottom: 5000,
226 scrollSensitivity: 10,
230 emptyCellDragMaxCols: null,
231 emptyCellDragMaxRows: null,
232 ignoreContentClass: 'gridster-item-content',
233 enableOccupiedCellDrop: true,
234 ignoreMarginInRow: false,
243 disablePushOnDrag: false,
244 disablePushOnResize: false,
245 pushDirections: {north: true, east: true, south: true, west: true},
246 pushResizeItems: true,
247 disableWindowResize: true,
248 disableWarnings: false,
249 scrollToNewItems: true,
250 enableDropToAdd: true,
251 enableEmptyCellDrop: true,
255 this._runService.getDashboardReportFormFields(this.inputReportId)
256 .subscribe((dashboardFormFields) => {
257 this.changeDetectorRefs.detectChanges();
258 this._runService.runDashboardReport(this.inputReportId, this.queryString)
259 .subscribe((runDashboardReportResp) => {
260 if (runDashboardReportResp) {
261 this.isDashboardExcelReadyToDownload = true;
262 this.changeDetectorRefs.detectChanges();
265 this.download_in_progress = false;
269 this.showDashboardReport = true;
272 this.hitCnt = this.runButtonHitCnt;
273 this.initialQueryString = this.queryString;
278 this.afterViewInitialProcesses();
281 afterViewInitialProcesses() {
282 if (sessionStorage.length > 0) {
283 this.showBackButton = true;
285 this.showBackButton = false;
287 if (this.DashboardReportObj.length === 0) {
288 if (this.reportMode === 'Regular' && this.initCnt == 0) {
289 this.showMoreVert = false;
290 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
291 this.displayedColumnsArr = [];
292 this.displayedRowObj = [];
293 this.displayedColumns = [];
294 this.formFieldList = [];
295 this.showSpinner = true;
296 this.isReady = false;
297 this.NEWdisplayedColumns = [];
298 this.timeTaken = '...';
299 const startDate: Date = new Date();
300 const startTime = startDate.getTime();
301 this._runService.getReportData(this.inputReportId)
302 .subscribe((response) => {
303 if (response['errormessage']) {
304 this.openErrorModel(response['errormessage']);
306 this.changeDetectorRefs.detectChanges();
308 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
309 this.inputReportId + '&refresh=Y&display_content=Y&r_page=0';
310 this.postFetchingReportDataFn(response, false, 0);
311 const endDate: Date = new Date();
312 const endTime = endDate.getTime();
313 this.showMoreVert = true;
316 this.openErrorModel('Error occurred while running report: ' + this.inputReportId);
320 this.showMoreVert = false;
321 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
322 this.displayedColumnsArr = [];
323 this.displayedRowObj = [];
324 this.displayedColumns = [];
325 this.formFieldList = [];
326 this.showSpinner = true;
327 this.isReady = false;
328 this.NEWdisplayedColumns = [];
329 this.timeTaken = '...';
330 const startDate: Date = new Date();
331 const startTime = startDate.getTime();
332 if (localStorage.getItem(this.inputReportId)) {
333 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
334 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
335 this.postFetchingReportDataFn(JSON.parse(localStorage.getItem(this.inputReportId)), false, 0);
336 this.saveResponseObj = JSON.parse(localStorage.getItem(this.inputReportId));
337 const endDate: Date = new Date();
338 const endTime = endDate.getTime();
339 this.showMoreVert = true;
340 localStorage.removeItem(this.inputReportId);
341 this.isGoBack = 'true';
343 this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId, this.groupSelectValue)
344 .subscribe((response) => {
345 if (response['errormessage']) {
346 this.openErrorModel(response['errormessage']);
348 this.changeDetectorRefs.detectChanges();
350 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
351 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
352 this.saveResponseObj = response;
353 this.postFetchingReportDataFn(response, false, 0);
354 const endDate: Date = new Date();
355 const endTime = endDate.getTime();
356 this.showMoreVert = true;
359 this.openErrorModel('Error occurred while running report: ' + this.inputReportId);
365 this.showMoreVert = true;
366 this.showSpinner = false;
368 this.errorMessage = '';
374 this.showSpinner = false;
375 this.isChartAvailable = false;
376 this.changeDetectorRefs.detectChanges();
379 postFetchingReportDataFn(response: any, isPageChange: boolean, pagenum: any) {
381 this.totalRecords = 0;
382 this.displayedColumnsArr = [];
383 this.displayedColumns = [];
384 this.formFieldPresent = false;
385 this.responseFormFieldListLength = 0;
386 this.reportName = response['reportName'];
388 this.timeTaken = (response['totalRunTime'] / 1000).toString();
389 this.displayedColumnsArr.push('RowNum,RowNum');
390 while (response['reportDataColumns'][rdc_cntr]) {
391 const columnTitle = response['reportDataColumns'][rdc_cntr]['columnTitle'];
392 const columnId = response['reportDataColumns'][rdc_cntr]['colId'];
393 this.displayedColumnsArr.push(columnTitle + ',' + columnId);
397 if (response['chartWizardAvailable'] === true && this.chartType !== 'none') {
398 this.isChartAvailable = true;
399 this.iframe.nativeElement.setAttribute('src', this.chartRunUrl);
403 while (response['reportTotalDataRows'][totalCnt]) {
404 this.displayTotal.push(response['reportTotalDataRows'][totalCnt]);
409 while (response['reportDataRows'][rdr_cntr]) {
412 const reportDataRows = response['reportDataRows'][rdr_cntr];
413 while (this.displayedColumnsArr[dca_cntr]) {
414 const rowColumnId = this.displayedColumnsArr[dca_cntr].split(',')[1];
415 if (reportDataRows[rowColumnId]) {
416 let drillDownHtml = '';
417 let displayValue = '';
418 drillDownHtml = reportDataRows[rowColumnId]['drillDownURL'];
419 displayValue = reportDataRows[rowColumnId]['displayValue'];
420 if (drillDownHtml !== null &&
421 drillDownHtml.length > 0 &&
422 !displayValue.includes('linkToReport')) {
423 const value = this.convertToLinkToReport(drillDownHtml);
424 if (value.length > 0) {
425 this.replaceDisplayValue = value + ',' +
426 reportDataRows[rowColumnId]['displayValue'];
428 this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
431 this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
433 let displayObj: DisplayHtml = new class implements DisplayHtml {
434 'background-color': string;
435 'font-family': string;
437 'font-style': string;
438 'font-weight': string;
439 'text-align': string;
440 'text-decoration': string;
443 if (reportDataRows[rowColumnId]['displayValueHtml'].includes('setStyle')) {
444 displayObj = JSON.parse(reportDataRows[rowColumnId]['displayValueHtml']);
446 displayObj['text-align'] = reportDataRows[rowColumnId]['alignment'];
447 obj['RowNum'] = (pagenum * response['pageSize'] + rdr_cntr + 1) + '|{"text-align":"center"}';
448 if (this.replaceDisplayValue.includes('linkToReport') || this.replaceDisplayValue.includes('linkToFeedback') || this.replaceDisplayValue.includes('linkToMail')
449 || this.replaceDisplayValue.includes('linkToMap')) {
450 let replaceValArr = new Array();
451 if (this.replaceDisplayValue.includes('linkToReport')) {
452 obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|');
453 replaceValArr = obj[reportDataRows[rowColumnId]['colId']].split('|');
454 if (replaceValArr.length > 4) {
455 const dispValue = replaceValArr[3] + ',' + replaceValArr[4];
456 obj[reportDataRows[rowColumnId]['colId']] = obj[reportDataRows[rowColumnId]['colId']].replace(replaceValArr[3] + '|' + replaceValArr[4], replaceValArr[3] + ',' + replaceValArr[4])+ '|' + JSON.stringify(displayObj);
458 obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
459 + '|' + JSON.stringify(displayObj);
462 obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
463 + '|' + JSON.stringify(displayObj);
466 obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split('comment-break-line').join('')
467 + '|' + JSON.stringify(displayObj);
472 this.displayedRowObj.push(obj);
475 this.pageSize = response['pageSize'];
476 for (let cntr = 0; cntr < this.displayedColumnsArr.length; cntr++) {
477 const columnArrId = this.displayedColumnsArr[cntr].split(',')[1];
478 this.displayedColumns.push(columnArrId);
480 this.totalRecords = 0;
481 this.totalRecords = response['totalRows'];
482 this.showSpinner = false;
484 this.paginator.length = this.totalRecords;
485 this.paginator.pageSize = this.pageSize;
486 this.paginator.pageIndex = 0;
488 this.dataSource.data = this.displayedRowObj;
489 this.dataSource.sort = this.sort;
490 this.changeDetectorRefs.detectChanges();
493 linkToReport(reportID: string, queryParameters: string) {
494 if (!this.httpCacheService.getPreviousId(this.inputReportId)) {
495 this.httpCacheService.setPreviousId(this.inputReportId, 'parent');
497 this.httpCacheService.setPreviousId(reportID, this.inputReportId);
498 /* localStorage.setItem(this.inputReportId, JSON.stringify(this.saveResponseObj));
499 if (sessionStorage.length === 0) {
500 sessionStorage.setItem('1', this.inputReportId + '|' + this.queryString);
502 let length = sessionStorage.length;
504 sessionStorage.setItem(length.toString(), this.inputReportId + '|' + this.queryString);
506 let queryParamsArr = new Array();
507 let columnDrilldownqueryParamsArr = new Array();
508 let groupSelectValue = '';
509 if (queryParameters.includes('groupSelectValue')) {
510 queryParamsArr = queryParameters.split('&');
511 for (let val = 0; val < queryParamsArr.length; val++) {
512 if (queryParamsArr[val].includes('groupSelectValue')) {
513 groupSelectValue = queryParamsArr[val].substring(queryParamsArr[val].indexOf('=') + 1, queryParamsArr[val].length);
516 this._router.navigate(['v2/run', reportID, queryParameters, groupSelectValue]);
517 } else if (queryParameters.includes('SELECTCRITERIA-')) {
518 columnDrilldownqueryParamsArr = queryParameters.split('&');
519 for (let val = 0; val < columnDrilldownqueryParamsArr.length; val++) {
520 if (columnDrilldownqueryParamsArr[val].includes('SELECTCRITERIA-')) {
521 groupSelectValue = columnDrilldownqueryParamsArr[val].substring(columnDrilldownqueryParamsArr[val].indexOf('-') + 1, columnDrilldownqueryParamsArr[val].length);
524 this._router.navigate(['v2/run', reportID, queryParameters, groupSelectValue, 'true', '']);
526 this._router.navigate(['v2/run', reportID, queryParameters, '' , 'true', '']);
531 linkToMail(mailId: string) {
532 this.changeDetectorRefs.detectChanges();
533 const email = 'mailto:' + mailId;
534 window.location.href = email;
538 this.changeDetectorRefs.detectChanges();
539 this.openOptionsFlag = !this.openOptionsFlag;
542 downloadReport(contentType: string, extension: string) {
544 this.changeDetectorRefs.detectChanges();
545 if (this.showDashboardReport === false) {
546 this.download_in_progress = true;
547 this._runService.downloadReport(this.inputReportId, extension,this.isGoBack)
548 .subscribe((responseExcel) => {
550 this.downLoadFile(responseExcel, contentType, extension, '');
551 this.download_in_progress = false;
552 this.changeDetectorRefs.detectChanges();
555 this.download_in_progress = true;
556 this._runService.getDashboardReportFormFields(this.inputReportId)
557 .subscribe((dashboardFormFields) => {
558 /* this._runService.runDashboardReport(this.inputReportId, this.queryString)
559 .subscribe((runDashboardReportResp) => {*/
560 this._runService.downloadDashboardReportExcel(this.inputReportId)
561 .subscribe((responseDownloadDashboardReport) => {
562 this.downLoadFile(responseDownloadDashboardReport, contentType, extension, 'Dashboard');
563 this.download_in_progress = false;
564 this.changeDetectorRefs.detectChanges();
572 downloadSinglePage(contentType: string, extension: string) {
573 this.changeDetectorRefs.detectChanges();
574 this.download_in_progress = true;
575 this._runService.downloadSinglePageReport(this.inputReportId, extension, this.isGoBack)
576 .subscribe((responseExcel) => {
578 this.downLoadFile(responseExcel, contentType, extension, '');
579 this.download_in_progress = false;
580 this.changeDetectorRefs.detectChanges();
584 downLoadFile(data: any, type: string, extension: string, reportType: string) {
585 const blob = new Blob([data], {type: type});
586 const date = new Date();
588 ('00' + (date.getMonth() + 1)).slice(-2) +
589 ('00' + date.getDate()).slice(-2) +
591 ('00' + date.getHours()).slice(-2) +
592 ('00' + date.getMinutes()).slice(-2) +
593 ('00' + date.getMilliseconds());
594 let fileName = this.reportName + dateStr + '.' + extension;
595 if (reportType === 'Dashboard') {
597 fileName = reportType + '_' + this.inputReportId + '_' + dateStr + '.' + extension;
599 if (window.navigator.msSaveOrOpenBlob) {
600 window.navigator.msSaveBlob(blob, fileName);
602 const anchor = window.document.createElement('a');
603 anchor.href = window.URL.createObjectURL(blob);
604 anchor.download = fileName;
605 document.body.appendChild(anchor);
607 document.body.removeChild(anchor);
608 window.URL.revokeObjectURL(anchor.href);
612 applyFilter(filterValue: string) {
613 this.changeDetectorRefs.detectChanges();
614 this.dataSource.data = this.displayedRowObj;
615 this.dataSource.sort = this.sort;
616 if (filterValue === '' || filterValue === null) {
618 this.dataSource.filter = filterValue.trim().toLowerCase();
619 this.changeDetectorRefs.detectChanges();
623 setStyle(rowData: string) {
625 if (rowData.split('|')[0] === 'linkToReport') {
626 styles = rowData.split('|')[4];
627 } else if (rowData.split('|')[0] === 'linkToMail') {
628 styles = rowData.split('|')[3];
630 styles = rowData.split('|')[1];
632 if (styles.includes('{')) {
633 return JSON.parse(styles);
641 getDisplayTotal(keys: string) {
642 if (this.displayTotal.length > 0 && this.displayTotal[0][keys]) {
643 return this.displayTotal[0][keys].displayValue;
649 onPaginationChange(event: any) {
650 this.changeDetectorRefs.detectChanges();
651 if (this.DashboardReportObj.length === 0) {
652 if (this.reportMode === 'Regular' && this.initCnt === 0) {
653 this.showMoreVert = false;
654 this.displayedColumnsArr = [];
655 this.displayedRowObj = [];
656 this.displayedColumns = [];
657 this.formFieldList = [];
658 this.showSpinner = true;
659 this.isReady = false;
660 this.NEWdisplayedColumns = [];
661 this.isChartAvailable = false;
662 this.timeTaken = '...';
663 const startDate: Date = new Date();
664 const startTime = startDate.getTime();
665 this._runService.getReportDataWithPageNo(this.inputReportId, event.pageIndex)
666 .subscribe((response) => {
667 if (response['errormessage']) {
668 this.openErrorModel(response['errormessage']);
670 this.changeDetectorRefs.detectChanges();
672 const endDate: Date = new Date();
673 const endTime = endDate.getTime();
674 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
675 this.inputReportId + '&refresh=Y&display_content=Y&r_page=' + event.pageIndex;
676 this.postFetchingReportDataFn(response, true, event.pageIndex);
677 this.showMoreVert = true;
680 this.openErrorModel('Error occurred while running report: ' + this.inputReportId);
684 this.showMoreVert = false;
685 this.displayedColumnsArr = [];
686 this.displayedRowObj = [];
687 this.displayedColumns = [];
688 this.formFieldList = [];
689 this.showSpinner = true;
690 this.isReady = false;
691 this.NEWdisplayedColumns = [];
692 this.isChartAvailable = false;
693 this.timeTaken = '...';
694 const startDate: Date = new Date();
695 const startTime = startDate.getTime();
696 this._runService.getReportDataWithFormFieldsWithPageNo(this.queryString, this.inputReportId, event.pageIndex)
697 .subscribe((response) => {
698 if (response['errormessage']) {
699 this.openErrorModel(response['errormessage']);
701 this.changeDetectorRefs.detectChanges();
703 const endDate: Date = new Date();
704 const endTime = endDate.getTime();
705 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
706 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=' + event.pageIndex;
707 this.postFetchingReportDataFn(response, true, event.pageIndex);
708 this.showMoreVert = true;
711 this.openErrorModel('Error occurred while running report: ' + this.inputReportId);
716 this.showMoreVert = true;
717 this.showSpinner = false;
719 this.errorMessage = '';
724 convertToLinkToReport(value: string) {
725 value = value.replace(/;/g, '');
727 while (value.includes('c_master=')) {
728 const index = value.indexOf('c_master=');
730 value = value.substring(index, value.length);
731 } else if (index === 0) {
732 value = value.replace('c_master=', '');
735 const split = value.split('&');
736 if (split[1].length <= 0) {
739 outPut = 'linkToReport,' + split[0] + ',';
740 let splitCounter = 1;
741 for (splitCounter = 1; splitCounter < split.length; splitCounter++) {
742 if (!split[splitCounter].includes('LOGIN_ID=') &&
743 !split[splitCounter].includes('display_content=') &&
744 !split[splitCounter].includes('drilldown_index=') &&
745 !split[splitCounter].includes('show_back_btn=') &&
746 !split[splitCounter].includes('r_action')) {
747 outPut = outPut + '&' + split[splitCounter];
753 takeToReport(queryString: string, reportID: string) {
754 this._router.navigate(['v2/run', reportID, queryString, this.groupSelectValue]);
758 this.changeDetectorRefs.detectChanges();
759 const length = sessionStorage.length;
761 let queryString = '';
764 split = sessionStorage.getItem((length).toString()).split('|');
766 queryString = split[1];
767 sessionStorage.removeItem((length).toString());
768 } else if (length === 1) {
770 split = sessionStorage.getItem('1').split('|');
772 queryString = split[1];
773 sessionStorage.removeItem('1');
775 localStorage.removeItem(this.inputReportId);
776 this._router.navigate(['v2/run', repId, queryString]);
779 openErrorModel(_message: string) {
780 this.changeDetectorRefs.detectChanges();
781 const modalInfoRef = this.ngbModal.open(ErrorModalComponent);
782 modalInfoRef.componentInstance.message = _message;