af61a97cbf3e14a6872973e1a13eb9559e44477f
[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 { NgbModal } from '@ng-bootstrap/ng-bootstrap';
24 import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
25
26 export interface PeriodicElement {
27
28 }
29
30 const ELEMENT_DATA: PeriodicElement[] = [{}];
31
32 @Component({
33     selector: 'app-run-report',
34     templateUrl: './run-report.component.html',
35     styleUrls: ['./run-report.component.css'],
36     changeDetection: ChangeDetectionStrategy.OnPush
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     @Input('chartType') chartType: string;
48     @ViewChild('iframe') iframe: ElementRef;
49     @ViewChild(MatPaginator, { static: false } as any) paginator: MatPaginator;
50     @ViewChild(MatSort, { static: false } as any) sort: MatSort;
51     dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
52     displayedColumns: string[];
53     IncomingReportId: string;
54     displayedColumnsArr: string[];
55     displayedRowObj: PeriodicElement[];
56     formFieldPresent: boolean;
57     showSpinner: boolean;
58     formFieldList: {}[];
59     isReady: boolean;
60     responseFormFieldListLength: number;
61     NEWdisplayedColumns: string[];
62     initCnt: number;
63     reportName: string;
64     showDashboardReport: boolean;
65     checkCnt: number;
66     options: GridsterConfig;
67     dashboard: Array<GridsterItem> = [];
68     openOptionsFlag: boolean;
69     showMoreVert: boolean;
70     errorMessage = '';
71     stackTrace = '';
72     error = false;
73     environment: any;
74     initialQueryString: string;
75     initCounter: number;
76     runButtonHitCnt: number;
77     chartRunUrl: string;
78     url: SafeResourceUrl;
79     replaceDisplayValue: String;
80     nodeName: string;
81     uploadId: string;
82     ecgi: string;
83     lac: string;
84     cid: string;
85     displayTotal: any[];
86     totalRecords: number;
87     pageSize: number;
88     download_in_progress: boolean;
89     commentCtrl = new FormControl('');
90     isChartAvailable = false;
91     timeTaken = '...';
92     saveResponseObj: any;
93     showBackButton = 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     ngAfterViewInit() {
251         this.afterViewInitialProcesses();
252     }
253
254     afterViewInitialProcesses() {
255         if (sessionStorage.length > 0) {
256             this.showBackButton = true;
257         } else {
258             this.showBackButton = false;
259         }
260         if (this.DashboardReportObj.length === 0) {
261             if (this.reportMode === 'Regular' && this.initCnt == 0) {
262                 this.showMoreVert = false;
263                 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
264                 this.displayedColumnsArr = [];
265                 this.displayedRowObj = [];
266                 this.displayedColumns = [];
267                 this.formFieldList = [];
268                 this.showSpinner = true;
269                 this.isReady = false;
270                 this.NEWdisplayedColumns = [];
271                 this.timeTaken = '...';
272                 const startDate: Date = new Date();
273                 const startTime = startDate.getTime();
274                 this._runService.getReportData(this.inputReportId)
275                     .subscribe((response) => {
276                         if (response['errormessage']) {
277                             this.showError(response);
278                         } else {
279                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
280                                 this.inputReportId + '&refresh=Y&display_content=Y&r_page=0';
281                             this.postFetchingReportDataFn(response, false);
282                             const endDate: Date = new Date();
283                             const endTime = endDate.getTime();
284                             this.timeTaken = ((endTime - startTime) / 1000).toString();
285                             this.showMoreVert = true;
286                         }
287                     });
288             } else {
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                 if (localStorage.getItem(this.inputReportId)) {
302                     this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
303                         this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
304                     this.postFetchingReportDataFn(JSON.parse(localStorage.getItem(this.inputReportId)), false);
305                     this.saveResponseObj = JSON.parse(localStorage.getItem(this.inputReportId));
306                     const endDate: Date = new Date();
307                     const endTime = endDate.getTime();
308                     this.timeTaken = ((endTime - startTime) / 1000).toString();
309                     this.showMoreVert = true;
310                     localStorage.removeItem(this.inputReportId);
311                 } else {
312                     this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
313                         .subscribe((response) => {
314                             if (response['errormessage']) {
315                                 this.showError(response);
316                             } else {
317                                 this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
318                                     this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
319                                 this.saveResponseObj = response;
320                                 this.postFetchingReportDataFn(response, false);
321                                 const endDate: Date = new Date();
322                                 const endTime = endDate.getTime();
323                                 this.timeTaken = ((endTime - startTime) / 1000).toString();
324                                 this.showMoreVert = true;
325                             }
326                         });
327                 }
328             }
329         } else {
330             this.showMoreVert = true;
331             this.showSpinner = false;
332         }
333         this.errorMessage = '';
334         this.error = false;
335         this.initCnt = 1;
336     }
337
338     showError(Errresponse: any) {
339         this.errorMessage = Errresponse['errormessage'];
340         this.stackTrace = Errresponse['stacktrace'];
341         this.error = true;
342         this.showSpinner = false;
343         this.isChartAvailable = false;
344     }
345
346     postFetchingReportDataFn(response: any, isPageChange: boolean) {
347         this.pageSize = 0;
348         this.totalRecords = 0;
349         this.displayedColumnsArr = [];
350         this.displayedColumns = [];
351         this.formFieldPresent = false;
352         this.responseFormFieldListLength = 0;
353         this.reportName = response['reportName'];
354         let rdc_cntr = 0;
355         while (response['reportDataColumns'][rdc_cntr]) {
356             const columnTitle = response['reportDataColumns'][rdc_cntr]['columnTitle'];
357             const columnId = response['reportDataColumns'][rdc_cntr]['colId'];
358             this.displayedColumnsArr.push(columnTitle + ',' + columnId);
359             rdc_cntr++;
360         }
361
362         if (response['chartWizardAvailable'] === true && this.chartType !== 'none') {
363             this.isChartAvailable = true;
364             this.iframe.nativeElement.setAttribute('src', this.chartRunUrl);
365         }
366
367         let totalCnt = 0;
368         while (response['reportTotalDataRows'][totalCnt]) {
369             this.displayTotal.push(response['reportTotalDataRows'][totalCnt]);
370             totalCnt++;
371         }
372
373         let rdr_cntr = 0;
374         while (response['reportDataRows'][rdr_cntr]) {
375             let dca_cntr = 0;
376             const obj = {};
377             const reportDataRows = response['reportDataRows'][rdr_cntr];
378             while (this.displayedColumnsArr[dca_cntr]) {
379                 const rowColumnId = this.displayedColumnsArr[dca_cntr].split(',')[1];
380                 if (reportDataRows[rowColumnId]) {
381                     let drillDownHtml = '';
382                     let displayValue = '';
383                     drillDownHtml = reportDataRows[rowColumnId]['drillDownURL'];
384                     displayValue = reportDataRows[rowColumnId]['displayValue'];
385                     if (drillDownHtml !== null &&
386                         drillDownHtml.length > 0 &&
387                         !displayValue.includes('linkToReport')) {
388                         const value = this.convertToLinkToReport(drillDownHtml);
389                         if (value.length > 0) {
390                             this.replaceDisplayValue = value + ',' +
391                                 reportDataRows[rowColumnId]['displayValue'];
392                         } else {
393                             this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
394                         }
395                     } else {
396                         this.replaceDisplayValue = reportDataRows[rowColumnId]['displayValue'];
397                     }
398                     let displayObj: DisplayHtml = new class implements DisplayHtml {
399                         'background-color': string;
400                         'font-family': string;
401                         'font-size': string;
402                         'font-style': string;
403                         'font-weight': string;
404                         'text-align': string;
405                         'text-decoration': string;
406                         color: string;
407                     };
408                     if (reportDataRows[rowColumnId]['displayValueHtml'].includes('{')) {
409                         displayObj = JSON.parse(reportDataRows[rowColumnId]['displayValueHtml']);
410                     }
411                     displayObj['text-align'] = reportDataRows[rowColumnId]['alignment'];
412                     if (this.replaceDisplayValue.includes('linkToReport') || this.replaceDisplayValue.includes('linkToFeedback') || this.replaceDisplayValue.includes('linkToMail')) {
413                         obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue.split(',').join('|')
414                             + '|' + JSON.stringify(displayObj);
415                     } else {
416                         obj[reportDataRows[rowColumnId]['colId']] = this.replaceDisplayValue
417                             + '|' + JSON.stringify(displayObj);
418                     }
419                 }
420                 dca_cntr++;
421             }
422             this.displayedRowObj.push(obj);
423             rdr_cntr++;
424         }
425         this.pageSize = response['pageSize'];
426         for (let cntr = 0; cntr < this.displayedColumnsArr.length; cntr++) {
427             const columnArrId = this.displayedColumnsArr[cntr].split(',')[1];
428             this.displayedColumns.push(columnArrId);
429         }
430         this.totalRecords = 0;
431         this.totalRecords = response['totalRows'];
432         this.showSpinner = false;
433         if (!isPageChange) {
434             this.paginator.length = this.totalRecords;
435             this.paginator.pageSize = this.pageSize;
436             this.paginator.pageIndex = 0;
437         }
438         this.dataSource.data = this.displayedRowObj;
439         this.dataSource.sort = this.sort;
440
441     }
442
443     linkToReport(reportID: string, queryParameters: string) {
444         localStorage.setItem(this.inputReportId, JSON.stringify(this.saveResponseObj));
445         if (sessionStorage.length === 0) {
446             sessionStorage.setItem('1', this.inputReportId + '|' + this.queryString);
447         } else {
448             let length = sessionStorage.length;
449             length++;
450             sessionStorage.setItem(length.toString(), this.inputReportId + '|' + this.queryString);
451         }
452         this._router.navigate(['v2/app/run', reportID, queryParameters]);
453     }
454
455
456
457     linkToMail(mailId: string) {
458         const email = 'mailto:' + mailId;
459         window.location.href = email;
460     }
461
462     openOptions() {
463         this.openOptionsFlag = !this.openOptionsFlag;
464     }
465
466     downloadReport(contentType: string, extension: string) {
467
468         if (this.showDashboardReport === false) {
469             this.download_in_progress = true;
470             this._runService.downloadReport(this.inputReportId, extension)
471                 .subscribe((responseExcel) => {
472
473                     this.downLoadFile(responseExcel, contentType, extension, '');
474                     this.download_in_progress = false;
475                 });
476         } else {
477             this._runService.getDashboardReportFormFields(this.inputReportId)
478                 .subscribe((dashboardFormFields) => {
479                     this.download_in_progress = true;
480                     this._runService.runDashboardReport(this.inputReportId, this.queryString)
481                         .subscribe((runDashboardReportResp) => {
482                             this._runService.downloadDashboardReportExcel(this.inputReportId)
483                                 .subscribe((responseDownloadDashboardReport) => {
484                                     this.downLoadFile(responseDownloadDashboardReport, contentType, extension, 'Dashboard');
485                                 });
486                         });
487                     this.download_in_progress = false;
488                 });
489         }
490     }
491
492     downloadSinglePage(contentType: string, extension: string) {
493         this.download_in_progress = true;
494         this._runService.downloadSinglePageReport(this.inputReportId, extension)
495             .subscribe((responseExcel) => {
496
497                 this.downLoadFile(responseExcel, contentType, extension, '');
498                 this.download_in_progress = false;
499             });
500     }
501
502     downLoadFile(data: any, type: string, extension: string, reportType: string) {
503         const blob = new Blob([data], { type: type });
504         const date = new Date();
505         const dateStr =
506             ('00' + (date.getMonth() + 1)).slice(-2) +
507             ('00' + date.getDate()).slice(-2) +
508             date.getFullYear() +
509             ('00' + date.getHours()).slice(-2) +
510             ('00' + date.getMinutes()).slice(-2) +
511             ('00' + date.getMilliseconds());
512         let fileName = this.reportName + dateStr + '.' + extension;
513         if (reportType === 'Dashboard') {
514             fileName = '';
515             fileName = reportType + '_' + this.inputReportId + '_' + dateStr + '.' + extension;
516         }
517         if (window.navigator.msSaveOrOpenBlob) {
518             window.navigator.msSaveBlob(blob, fileName);
519         } else {
520             const anchor = window.document.createElement('a');
521             anchor.href = window.URL.createObjectURL(blob);
522             anchor.download = fileName;
523             document.body.appendChild(anchor);
524             anchor.click();
525             document.body.removeChild(anchor);
526             window.URL.revokeObjectURL(anchor.href);
527         }
528     }
529
530     applyFilter(filterValue: string) {
531         this.dataSource.data = this.displayedRowObj;
532         this.dataSource.sort = this.sort;
533         if (filterValue === '' || filterValue === null) {
534         } else {
535             this.dataSource.filter = filterValue.trim().toLowerCase();
536         }
537     }
538
539     setStyle(rowData: string) {
540         let styles = '';
541         if (rowData.split('|')[0] === 'linkToReport') {
542             styles = rowData.split('|')[4];
543         } else if (rowData.split('|')[0] === 'linkToMail') {
544             styles = rowData.split('|')[3];
545         } else {
546             styles = rowData.split('|')[1];
547         }
548         if (styles.includes('{')) {
549             return JSON.parse(styles);
550         } else {
551             return {};
552         }
553     }
554
555     
556
557     getDisplayTotal(keys: string) {
558         if (this.displayTotal.length > 0) {
559             return this.displayTotal[0][keys].displayValue;
560         } else {
561             return '';
562         }
563     }
564
565     onPaginationChange(event: any) {
566         if (this.DashboardReportObj.length === 0) {
567             if (this.reportMode === 'Regular' && this.initCnt === 0) {
568                 this.showMoreVert = false;
569                 this.displayedColumnsArr = [];
570                 this.displayedRowObj = [];
571                 this.displayedColumns = [];
572                 this.formFieldList = [];
573                 this.showSpinner = true;
574                 this.isReady = false;
575                 this.NEWdisplayedColumns = [];
576                 this.isChartAvailable = false;
577                 this.timeTaken = '...';
578                 const startDate: Date = new Date();
579                 const startTime = startDate.getTime();
580                 this._runService.getReportDataWithPageNo(this.inputReportId, event.pagenum)
581                     .subscribe((response) => {
582                         if (response['errormessage']) {
583                             this.showError(response);
584                         } else {
585                             const endDate: Date = new Date();
586                             const endTime = endDate.getTime();
587                             this.timeTaken = ((endTime - startTime) / 1000).toString();
588                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
589                                 this.inputReportId + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
590                             this.postFetchingReportDataFn(response, true);
591                             this.showMoreVert = true;
592                         }
593                     });
594             } else {
595                 this.showMoreVert = false;
596                 this.displayedColumnsArr = [];
597                 this.displayedRowObj = [];
598                 this.displayedColumns = [];
599                 this.formFieldList = [];
600                 this.showSpinner = true;
601                 this.isReady = false;
602                 this.NEWdisplayedColumns = [];
603                 this.isChartAvailable = false;
604                 this.timeTaken = '...';
605                 const startDate: Date = new Date();
606                 const startTime = startDate.getTime();
607                 this._runService.getReportDataWithFormFieldsWithPageNo(this.queryString, this.inputReportId, event.pageIndex)
608                     .subscribe((response) => {
609                         if (response['errormessage']) {
610                             this.showError(response);
611                         } else {
612                             const endDate: Date = new Date();
613                             const endTime = endDate.getTime();
614                             this.timeTaken = ((endTime - startTime) / 1000).toString();
615                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
616                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
617                             this.postFetchingReportDataFn(response, true);
618                             this.showMoreVert = true;
619                         }
620                     });
621             }
622         } else {
623             this.showMoreVert = true;
624             this.showSpinner = false;
625         }
626         this.errorMessage = '';
627         this.error = false;
628         this.initCnt = 1;
629     }
630
631     convertToLinkToReport(value: string) {
632         value = value.replace(/;/g, '');
633         let outPut = '';
634         while (value.includes('c_master=')) {
635             const index = value.indexOf('c_master=');
636             if (index > 0) {
637                 value = value.substring(index, value.length);
638             } else if (index === 0) {
639                 value = value.replace('c_master=', '');
640             }
641         }
642         const split = value.split('&');
643         if (split[1].length <= 0) {
644             return outPut;
645         }
646         outPut = 'linkToReport,' + split[0] + ',';
647         let splitCounter = 1;
648         for (splitCounter = 1; splitCounter < split.length; splitCounter++) {
649             if (!split[splitCounter].includes('LOGIN_ID=') &&
650                 !split[splitCounter].includes('display_content=') &&
651                 !split[splitCounter].includes('drilldown_index=') &&
652                 !split[splitCounter].includes('show_back_btn=') &&
653                 !split[splitCounter].includes('r_action')) {
654                 outPut = outPut + '&' + split[splitCounter];
655             }
656         }
657         return outPut;
658     }
659
660     takeToReport(queryString: string, reportID: string) {
661         this._router.navigate(['v2/app/run', reportID, queryString, this.groupSelectValue]);
662     }
663
664     goBack() {
665         const length = sessionStorage.length;
666         let repId = '';
667         let queryString = '';
668         if (length > 1) {
669             let split = [];
670             split = sessionStorage.getItem((length).toString()).split('|');
671             repId = split[0];
672             queryString = split[1];
673             sessionStorage.removeItem((length).toString());
674         } else if (length === 1) {
675             let split = [];
676             split = sessionStorage.getItem('1').split('|');
677             repId = split[0];
678             queryString = split[1];
679             sessionStorage.removeItem('1');
680         }
681         localStorage.removeItem(this.inputReportId);
682         this._router.navigate(['v2/app/run', repId, queryString]);
683     }
684
685 }