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