7e0ac549605eaabb731ef21d829666c9c530dcbc
[portal/sdk.git] /
1 import {
2     AfterViewInit,
3     Component,
4     OnInit,
5     ViewChild,
6     Input,
7     SimpleChange,
8     SimpleChanges,
9     ChangeDetectorRef,
10     Inject,
11     ElementRef
12 } from '@angular/core';
13 import {MatPaginator} from '@angular/material/paginator';
14 import {MatSort} from '@angular/material/sort';
15 import {MatTable, MatTableDataSource} from '@angular/material/table';
16 import {ActivatedRoute, Router} from '@angular/router';
17 import {HttpClient} from '@angular/common/http';
18 import {environment} from '../../../../../../../environments/environment';
19 import {RunService} from '../run.service';
20 import {GridsterConfig, GridsterItem, GridType} from 'angular-gridster2';
21 import {Observable} from 'rxjs';
22 import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser';
23 import {displayGrids} from 'angular-gridster2/lib/gridsterConfig.interface';
24 import {DisplayHtml} from '../../display-html';
25 import {FormControl} from '@angular/forms';
26
27 export interface PeriodicElement {
28
29 }
30
31 const ELEMENT_DATA: PeriodicElement[] = [{}];
32
33 @Component({
34     selector: 'app-run-report',
35     templateUrl: './run-report.component.html',
36     styleUrls: ['./run-report.component.css']
37 })
38 export class RunReportComponent implements OnInit, AfterViewInit {
39     @Input('reportId') inputReportId: string;
40     @Input('reportMode') reportMode: string;
41     @Input('queryString') queryString: string;
42     @Input('DashboardReportObj') DashboardReportObj: Array<GridsterItem>;
43     @Input('TriggerFFArr') TriggerFFArr: string[];
44     @Input('hitCnt') hitCnt: number;
45     @Input('runAgain') runAgain: string;
46     @Input('groupSelectValue') groupSelectValue: string;
47     @ViewChild('iframe') iframe: ElementRef;
48     @ViewChild(MatPaginator, {static: false} as any) paginator: MatPaginator;
49     @ViewChild(MatSort, {static: false} as any) sort: MatSort;
50     dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
51     displayedColumns: string[];
52     IncomingReportId: string;
53     displayedColumnsArr: string[];
54     displayedRowObj: PeriodicElement[];
55     formFieldPresent: boolean;
56     showSpinner: boolean;
57     formFieldList: {}[];
58     isReady: boolean;
59     responseFormFieldListLength: number;
60     NEWdisplayedColumns: string[];
61     initCnt: number;
62     reportName: string;
63     showDashboardReport: boolean;
64     checkCnt: number;
65     options: GridsterConfig;
66     dashboard: Array<GridsterItem> = [];
67     openOptionsFlag: boolean;
68     showMoreVert: boolean;
69     errorMessage = '';
70     stackTrace = '';
71     error = false;
72     environment: any;
73     initialQueryString: string;
74     initCounter: number;
75     runButtonHitCnt: number;
76     chartRunUrl: string;
77     url: SafeResourceUrl;
78     replaceDisplayValue: String;
79     nodeName: string;
80     uploadId: string;
81     ecgi: string;
82     lac: string;
83     cid: string;
84     displayTotal: any[];
85     totalRecords: number;
86     pageSize: number;
87     download_in_progress: boolean;
88     commentCtrl = new FormControl('');
89     isChartAvailable = false;
90     timeTaken = '...';
91     saveResponseObj: any;
92     showBackButton = false;
93     showChart: boolean = false;
94
95     constructor(private _http: HttpClient,
96         private _route: ActivatedRoute,
97         private _runService: RunService,
98         private _router: Router,
99         private changeDetectorRefs: ChangeDetectorRef,
100         public sanitizer: DomSanitizer) {
101         this.displayedColumnsArr = [];
102         this.displayedRowObj = [];
103         this.displayedColumns = [];
104         this.formFieldList = [];
105         this.showSpinner = true;
106         this.isReady = false;
107         this.NEWdisplayedColumns = [];
108         this.initCnt = 0;
109         this.checkCnt = 0;
110         this.showDashboardReport = false;
111         this.openOptionsFlag = false;
112         this.showMoreVert = false;
113         this.environment = environment;
114         this.initCounter = 0;
115         this.runButtonHitCnt = 0;
116         this.displayTotal = [];
117         this.totalRecords = 0;
118         this.pageSize = 0;
119         this.download_in_progress = false;
120
121     }
122
123     ngOnChanges(changes: SimpleChanges) {
124         if (this.reportMode !== 'Regular' && this.initCnt > 0 && changes['runAgain']) {
125             this.showMoreVert = false;
126             if (changes['queryString']) {
127                 this.queryString = changes['queryString']['currentValue'];
128             }
129             if (this.queryString !== this.initialQueryString) {
130                 this.initCnt = 1;
131                 this.showDashboardReport = false;
132                 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
133                 this.displayedColumnsArr = [];
134                 this.displayedRowObj = [];
135                 this.displayedColumns = [];
136                 this.formFieldList = [];
137                 this.showSpinner = true;
138                 this.isReady = false;
139                 this.NEWdisplayedColumns = [];
140                 this.displayTotal = [];
141                 this.isChartAvailable = false;
142                 this.timeTaken = '...';
143                 const startDate: Date = new Date();
144                 const startTime = startDate.getTime();
145                 this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
146                     .subscribe((response) => {
147                         if (response['errormessage']) {
148                             this.showError(response);
149                         } else {
150                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
151                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
152                             if (this.reportMode !== 'FormField') {
153                                 this.postFetchingReportDataFn(response, false);
154                                 const endDate: Date = new Date();
155                                 const endTime = endDate.getTime();
156                                 this.timeTaken = ((endTime - startTime) / 1000).toString();
157                                 this.showMoreVert = true;
158                                 this.showDashboardReport = true;
159                                 this.errorMessage = '';
160                                 this.error = false;
161                             } else {
162                                 this.postFetchingReportDataFn(response, false);
163                                 const endDate: Date = new Date();
164                                 const endTime = endDate.getTime();
165                                 this.timeTaken = ((endTime - startTime) / 1000).toString();
166                                 this.showMoreVert = true;
167                                 this.errorMessage = '';
168                                 this.error = false;
169                             }
170                         }
171                     });
172             }
173         } else {
174         }
175         if (this.initialQueryString !== this.queryString && this.initCounter > 0 && this.hitCnt !== this.runButtonHitCnt) {
176             this.runButtonHitCnt = this.hitCnt;
177             this.initialQueryString = this.queryString;
178             this.initialProcesses();
179         } else {
180             this.runButtonHitCnt = this.hitCnt;
181         }
182
183     }
184
185     ngOnInit() {
186         this.dataSource.paginator = this.paginator;
187         this.dataSource.sort = this.sort;
188         this.dataSource.data = this.displayedRowObj;
189         this.initialProcesses();
190         this.errorMessage = '';
191         this.error = false;
192     }
193
194     initialProcesses() {
195         if (this.DashboardReportObj.length > 0) {
196             this.dashboard = this.DashboardReportObj;
197             this.options = {
198                 gridType: GridType.ScrollVertical,
199                 margin: 10,
200                 outerMargin: true,
201                 outerMarginTop: 10,
202                 outerMarginRight: 10,
203                 outerMarginBottom: 5000,
204                 outerMarginLeft: 10,
205                 scrollSensitivity: 10,
206                 scrollSpeed: 20,
207                 emptyCellDragMaxCols: null,
208                 emptyCellDragMaxRows: null,
209                 ignoreContentClass: 'gridster-item-content',
210                 enableOccupiedCellDrop: true,
211                 ignoreMarginInRow: false,
212                 draggable: {
213                     enabled: true,
214                 },
215                 resizable: {
216                     enabled: true,
217                 },
218                 swap: true,
219                 pushItems: true,
220                 disablePushOnDrag: false,
221                 disablePushOnResize: false,
222                 pushDirections: {north: true, east: true, south: true, west: true},
223                 pushResizeItems: true,
224                 disableWindowResize: true,
225                 disableWarnings: false,
226                 scrollToNewItems: true,
227                 enableDropToAdd: true,
228                 enableEmptyCellDrop: true,
229                 minCols: 2,
230                 minRows: 2,
231             };
232             this._runService.getDashboardReportFormFields(this.inputReportId)
233             .subscribe((dashboardFormFields) => {
234                 this.download_in_progress = true;
235                 this._runService.runDashboardReport(this.inputReportId, this.queryString)
236                     .subscribe((runDashboardReportResp) => {
237                     });
238                 this.download_in_progress = false;
239             });
240
241
242             this.showDashboardReport = true;
243
244         }
245         this.hitCnt = this.runButtonHitCnt;
246         this.initialQueryString = this.queryString;
247         this.initCounter++;
248
249     }
250
251     ngAfterViewInit() {
252         this.afterViewInitialProcesses();
253     }
254
255     afterViewInitialProcesses() {
256         if (sessionStorage.length > 0) {
257             this.showBackButton = true;
258         } else {
259             this.showBackButton = false;
260         }
261         if (this.DashboardReportObj.length === 0) {
262             if (this.reportMode === 'Regular' && this.initCnt == 0) {
263                 this.showMoreVert = false;
264                 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
265                 this.displayedColumnsArr = [];
266                 this.displayedRowObj = [];
267                 this.displayedColumns = [];
268                 this.formFieldList = [];
269                 this.showSpinner = true;
270                 this.isReady = false;
271                 this.NEWdisplayedColumns = [];
272                 this.timeTaken = '...';
273                 const startDate: Date = new Date();
274                 const startTime = startDate.getTime();
275                 this._runService.getReportData(this.inputReportId)
276                     .subscribe((response) => {
277                         if (response['errormessage']) {
278                             this.showError(response);
279                         } else {
280                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
281                                 this.inputReportId + '&refresh=Y&display_content=Y&r_page=0';
282                             this.postFetchingReportDataFn(response, false);
283                             const endDate: Date = new Date();
284                             const endTime = endDate.getTime();
285                             this.timeTaken = ((endTime - startTime) / 1000).toString();
286                             this.showMoreVert = true;
287                         }
288                     });
289             } else {
290                 this.showMoreVert = false;
291                 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
292                 this.displayedColumnsArr = [];
293                 this.displayedRowObj = [];
294                 this.displayedColumns = [];
295                 this.formFieldList = [];
296                 this.showSpinner = true;
297                 this.isReady = false;
298                 this.NEWdisplayedColumns = [];
299                 this.timeTaken = '...';
300                 const startDate: Date = new Date();
301                 const startTime = startDate.getTime();
302                 if (localStorage.getItem(this.inputReportId)) {
303                     this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
304                         this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
305                     this.postFetchingReportDataFn(JSON.parse(localStorage.getItem(this.inputReportId)), false);
306                     this.saveResponseObj = JSON.parse(localStorage.getItem(this.inputReportId));
307                     const endDate: Date = new Date();
308                     const endTime = endDate.getTime();
309                     this.timeTaken = ((endTime - startTime) / 1000).toString();
310                     this.showMoreVert = true;
311                     localStorage.removeItem(this.inputReportId);
312                 } else {
313                 this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
314                     .subscribe((response) => {
315                         if (response['errormessage']) {
316                             this.showError(response);
317                         } else {
318                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
319                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
320                                 this.saveResponseObj = response;
321                             this.postFetchingReportDataFn(response, false);
322                             const endDate: Date = new Date();
323                             const endTime = endDate.getTime();
324                             this.timeTaken = ((endTime - startTime) / 1000).toString();
325                             this.showMoreVert = true;
326                         }
327                     });
328             }
329             }
330         } else {
331             this.showMoreVert = true;
332             this.showSpinner = false;
333         }
334         this.errorMessage = '';
335         this.error = false;
336         this.initCnt = 1;
337     }
338
339     showError(Errresponse: any) {
340         this.errorMessage = Errresponse['errormessage'];
341         this.stackTrace = Errresponse['stacktrace'];
342         this.error = true;
343         this.showSpinner = false;
344         this.isChartAvailable = false;
345     }
346
347     postFetchingReportDataFn(response: any, isPageChange: boolean) {
348         this.pageSize = 0;
349         this.totalRecords = 0;
350         this.displayedColumnsArr = [];
351         this.displayedColumns = [];
352         this.formFieldPresent = false;
353         this.responseFormFieldListLength = 0;
354         this.reportName = response['reportName'];
355         let rdc_cntr = 0;
356         while (response['reportDataColumns'][rdc_cntr]) {
357             const columnTitle = response['reportDataColumns'][rdc_cntr]['columnTitle'];
358             const columnId = response['reportDataColumns'][rdc_cntr]['colId'];
359             this.displayedColumnsArr.push(columnTitle + ',' + columnId);
360             rdc_cntr++;
361         }
362
363         if (response['chartWizardAvailable'] === true) {
364             this.isChartAvailable = true;
365             if(this.iframe){
366                 this.iframe.nativeElement.setAttribute('src', this.chartRunUrl);
367             }
368         }
369
370         let totalCnt = 0;
371         while (response['reportTotalDataRows'][totalCnt]) {
372             this.displayTotal.push(response['reportTotalDataRows'][totalCnt]);
373             totalCnt++;
374         }
375
376         let rdr_cntr = 0;
377         while (response['reportDataRows'][rdr_cntr]) {
378             let dca_cntr = 0;
379             const obj = {};
380             const reportDataRows = response['reportDataRows'][rdr_cntr];
381             while (this.displayedColumnsArr[dca_cntr]) {
382                 const rowColumnId = this.displayedColumnsArr[dca_cntr].split(',')[1];
383                 if (reportDataRows[rowColumnId]) {
384                     let drillDownHtml = '';
385                     let displayValue = '';
386                     drillDownHtml = reportDataRows[rowColumnId]['drillDownURL'];
387                     displayValue = reportDataRows[rowColumnId]['displayValue'];
388                     if (drillDownHtml !== null &&
389                         drillDownHtml.length > 0 &&
390                         !displayValue.includes('linkToReport')) {
391                         const value = this.convertToLinkToReport(drillDownHtml);
392                         if (value.length > 0) {
393                             this.replaceDisplayValue = value + ',' +
394                                 reportDataRows[rowColumnId]['displayValue'];
395                         } else {
396                             this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
397                         }
398                     } else {
399                         this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
400                     }
401                     let displayObj: DisplayHtml = new class implements DisplayHtml {
402                         'background-color': string;
403                         'font-family': string;
404                         'font-size': string;
405                         'font-style': string;
406                         'font-weight': string;
407                         'text-align': string;
408                         'text-decoration': string;
409                         color: string;
410                     };
411                     if (reportDataRows[rowColumnId]['displayValueHtml'].includes('{')) {
412                         displayObj = JSON.parse(reportDataRows[rowColumnId]['displayValueHtml']);
413                     }
414                     displayObj['text-align'] = reportDataRows[rowColumnId]['alignment'];
415                     if (this.replaceDisplayValue.includes('linkToReport') || this.replaceDisplayValue.includes('linkToFeedback') || this.replaceDisplayValue.includes('linkToMail')) {
416                         obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
417                             + '|' + JSON.stringify(displayObj);
418                     } else {
419                         obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue
420                             + '|' + JSON.stringify(displayObj);
421                     }
422                 }
423                 dca_cntr++;
424             }
425             this.displayedRowObj.push(obj);
426             rdr_cntr++;
427         }
428         this.pageSize = response['pageSize'];
429         for (let cntr = 0; cntr < this.displayedColumnsArr.length; cntr++) {
430             const columnArrId = this.displayedColumnsArr[cntr].split(',')[1];
431             this.displayedColumns.push(columnArrId);
432         }
433         this.totalRecords = 0;
434         this.totalRecords = response['totalRows'];
435         this.showSpinner = false;
436         if (!isPageChange) {
437             this.paginator.length = this.totalRecords;
438             this.paginator.pageSize = this.pageSize;
439             this.paginator.pageIndex = 0;
440         }
441         this.dataSource.data = this.displayedRowObj;
442         this.dataSource.sort = this.sort;
443         if(this.totalRecords >0){
444             this.showChart = true;
445         }
446
447     }
448
449     linkToReport(reportID: string, queryParameters: string) {
450         localStorage.setItem(this.inputReportId, JSON.stringify(this.saveResponseObj));
451         if (sessionStorage.length === 0) {
452             sessionStorage.setItem('1', this.inputReportId + '|' + this.queryString);
453         } else {
454             let length = sessionStorage.length;
455             length++;
456             sessionStorage.setItem(length.toString(), this.inputReportId + '|' + this.queryString);
457         }
458         this._router.navigate(['v2/run', reportID, queryParameters]);
459     }
460
461
462     linkToFeedback(feedBackId: string, queryParameters: string) {
463         this._router.navigate(['v2/feedback', feedBackId]);
464     }
465
466     linkToMail(mailId: string) {
467         const email = 'mailto:' + mailId;
468         window.location.href = email;
469     }
470
471     openOptions() {
472         this.openOptionsFlag = !this.openOptionsFlag;
473     }
474
475     downloadReport(contentType: string, extension: string) {
476
477         if (this.showDashboardReport === false) {
478             this.download_in_progress = true;
479             this._runService.downloadReport(this.inputReportId, extension)
480                 .subscribe((responseExcel) => {
481
482                     this.downLoadFile(responseExcel, contentType, extension, '');
483                     this.download_in_progress = false;
484                 });
485         } else {
486             this._runService.getDashboardReportFormFields(this.inputReportId)
487                 .subscribe((dashboardFormFields) => {
488                     this.download_in_progress = true;
489                     this._runService.runDashboardReport(this.inputReportId, this.queryString)
490                         .subscribe((runDashboardReportResp) => {
491                             this._runService.downloadDashboardReportExcel(this.inputReportId)
492                                 .subscribe((responseDownloadDashboardReport) => {
493                                     this.downLoadFile(responseDownloadDashboardReport, contentType, extension, 'Dashboard');
494                                 });
495                         });
496                     this.download_in_progress = false;
497                 });
498         }
499     }
500
501     downloadSinglePage(contentType: string, extension: string) {
502         this.download_in_progress = true;
503         this._runService.downloadSinglePageReport(this.inputReportId, extension)
504             .subscribe((responseExcel) => {
505
506                 this.downLoadFile(responseExcel, contentType, extension, '');
507                 this.download_in_progress = false;
508             });
509     }
510
511     downLoadFile(data: any, type: string, extension: string, reportType: string) {
512         const blob = new Blob([data], {type: type});
513         const dt = new Date();
514         const utcDate = dt.getTime();
515         let fileName = this.reportName + utcDate + '.' + extension;
516         if (reportType === 'Dashboard') {
517             fileName = '';
518             fileName = reportType + '-' + this.inputReportId + '.' + extension;
519         }
520         if (window.navigator.msSaveOrOpenBlob) {
521             window.navigator.msSaveBlob(blob, fileName);
522         } else {
523             const anchor = window.document.createElement('a');
524             anchor.href = window.URL.createObjectURL(blob);
525             anchor.download = fileName;
526             document.body.appendChild(anchor);
527             anchor.click();
528             document.body.removeChild(anchor);
529             window.URL.revokeObjectURL(anchor.href);
530         }
531     }
532
533     applyFilter(filterValue: string) {
534         this.dataSource.data = this.displayedRowObj;
535         this.dataSource.sort = this.sort;
536         if (filterValue === '' || filterValue === null) {
537         } else {
538             this.dataSource.filter = filterValue.trim().toLowerCase();
539         }
540     }
541
542     setStyle(styles: string) {
543         if (styles.includes('{')) {
544             return JSON.parse(styles);
545         } else {
546             return {};
547         }
548     }
549
550     getDisplayTotal(keys: string) {
551         if (this.displayTotal.length > 0) {
552             return this.displayTotal[0][keys].displayValue;
553         } else {
554             return '';
555         }
556     }
557
558     onPaginationChange(event: any) {
559         if (this.DashboardReportObj.length === 0) {
560             if (this.reportMode === 'Regular' && this.initCnt === 0) {
561                 this.showMoreVert = false;
562                 this.displayedColumnsArr = [];
563                 this.displayedRowObj = [];
564                 this.displayedColumns = [];
565                 this.formFieldList = [];
566                 this.showSpinner = true;
567                 this.isReady = false;
568                 this.NEWdisplayedColumns = [];
569                 this.isChartAvailable = false;
570                 this.timeTaken = '...';
571                 const startDate: Date = new Date();
572                 const startTime = startDate.getTime();
573                 this._runService.getReportDataWithPageNo(this.inputReportId, event.pagenum)
574                     .subscribe((response) => {
575                         if (response['errormessage']) {
576                             this.showError(response);
577                         } else {
578                             const endDate: Date = new Date();
579                             const endTime = endDate.getTime();
580                             this.timeTaken = ((endTime - startTime) / 1000).toString();
581                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
582                                 this.inputReportId + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
583                             this.postFetchingReportDataFn(response, true);
584                             this.showMoreVert = true;
585                         }
586                     });
587             } else {
588                 this.showMoreVert = false;
589                 this.displayedColumnsArr = [];
590                 this.displayedRowObj = [];
591                 this.displayedColumns = [];
592                 this.formFieldList = [];
593                 this.showSpinner = true;
594                 this.isReady = false;
595                 this.NEWdisplayedColumns = [];
596                 this.isChartAvailable = false;
597                 this.timeTaken = '...';
598                 const startDate: Date = new Date();
599                 const startTime = startDate.getTime();
600                 this._runService.getReportDataWithFormFieldsWithPageNo(this.queryString, this.inputReportId, event.pageIndex)
601                     .subscribe((response) => {
602                         if (response['errormessage']) {
603                             this.showError(response);
604                         } else {
605                             const endDate: Date = new Date();
606                             const endTime = endDate.getTime();
607                             this.timeTaken = ((endTime - startTime) / 1000).toString();
608                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
609                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
610                             this.postFetchingReportDataFn(response, true);
611                             this.showMoreVert = true;
612                         }
613                     });
614             }
615         } else {
616             this.showMoreVert = true;
617             this.showSpinner = false;
618         }
619         this.errorMessage = '';
620         this.error = false;
621         this.initCnt = 1;
622     }
623
624     convertToLinkToReport(value: string) {
625         value = value.replace(/;/g, '');
626         let outPut = '';
627         while (value.includes('c_master=')) {
628             const index = value.indexOf('c_master=');
629             if (index > 0) {
630                 value = value.substring(index, value.length);
631             } else if (index === 0) {
632                 value = value.replace('c_master=', '');
633             }
634         }
635         const split = value.split('&');
636         // const spltFirst = split[0].split('=');
637         if (split[1].length <= 0) {
638             return outPut;
639         }
640         outPut = 'linkToReport,' + split[0] + ',';
641         let splitCounter = 1;
642         for (splitCounter = 1; splitCounter < split.length; splitCounter++) {
643             if (!split[splitCounter].includes('LOGIN_ID=') &&
644                 !split[splitCounter].includes('display_content=') &&
645                 !split[splitCounter].includes('drilldown_index=') &&
646                 !split[splitCounter].includes('show_back_btn=') &&
647                 !split[splitCounter].includes('r_action')) {
648                 outPut = outPut + '&' + split[splitCounter];
649             }
650         }
651         return outPut;
652     }
653
654
655
656     takeToReport(queryString: string, reportID: string) {
657         this._router.navigate(['v2/run', reportID, queryString , this.groupSelectValue]);
658     }
659
660     goBack() {
661         const length = sessionStorage.length;
662         let repId = '';
663         let queryString = '';
664         if (length > 1) {
665             let split = [];
666             split = sessionStorage.getItem((length).toString()).split('|');
667             repId = split[0];
668             queryString = split[1];
669             sessionStorage.removeItem((length).toString());
670         } else if (length === 1) {
671             let split = [];
672             split = sessionStorage.getItem('1').split('|');
673             repId = split[0];
674             queryString = split[1];
675             sessionStorage.removeItem('1');
676         }
677         localStorage.removeItem(this.inputReportId);
678         this._router.navigate(['v2/run', repId, queryString]);
679     }
680
681 }
682