a21630546d8cd5c2a17733163391616b7f204943
[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
94     constructor(private _http: HttpClient,
95         private _route: ActivatedRoute,
96         private _runService: RunService,
97         private _router: Router,
98         private changeDetectorRefs: ChangeDetectorRef,
99         public sanitizer: DomSanitizer) {
100         this.displayedColumnsArr = [];
101         this.displayedRowObj = [];
102         this.displayedColumns = [];
103         this.formFieldList = [];
104         this.showSpinner = true;
105         this.isReady = false;
106         this.NEWdisplayedColumns = [];
107         this.initCnt = 0;
108         this.checkCnt = 0;
109         this.showDashboardReport = false;
110         this.openOptionsFlag = false;
111         this.showMoreVert = false;
112         this.environment = environment;
113         this.initCounter = 0;
114         this.runButtonHitCnt = 0;
115         this.displayTotal = [];
116         this.totalRecords = 0;
117         this.pageSize = 0;
118         this.download_in_progress = false;
119
120     }
121
122     ngOnChanges(changes: SimpleChanges) {
123         if (this.reportMode !== 'Regular' && this.initCnt > 0 && changes['runAgain']) {
124             this.showMoreVert = false;
125             if (changes['queryString']) {
126                 this.queryString = changes['queryString']['currentValue'];
127             }
128             if (this.queryString !== this.initialQueryString) {
129                 this.initCnt = 1;
130                 this.showDashboardReport = false;
131                 this.dataSource = new MatTableDataSource<PeriodicElement>(ELEMENT_DATA);
132                 this.displayedColumnsArr = [];
133                 this.displayedRowObj = [];
134                 this.displayedColumns = [];
135                 this.formFieldList = [];
136                 this.showSpinner = true;
137                 this.isReady = false;
138                 this.NEWdisplayedColumns = [];
139                 this.displayTotal = [];
140                 this.isChartAvailable = false;
141                 this.timeTaken = '...';
142                 const startDate: Date = new Date();
143                 const startTime = startDate.getTime();
144                 this._runService.getReportDataWithFormFields(this.queryString, this.inputReportId)
145                     .subscribe((response) => {
146                         if (response['errormessage']) {
147                             this.showError(response);
148                         } else {
149                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
150                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=0';
151                             if (this.reportMode !== 'FormField') {
152                                 this.postFetchingReportDataFn(response, false);
153                                 const endDate: Date = new Date();
154                                 const endTime = endDate.getTime();
155                                 this.timeTaken = ((endTime - startTime) / 1000).toString();
156                                 this.showMoreVert = true;
157                                 this.showDashboardReport = true;
158                                 this.errorMessage = '';
159                                 this.error = false;
160                             } else {
161                                 this.postFetchingReportDataFn(response, false);
162                                 const endDate: Date = new Date();
163                                 const endTime = endDate.getTime();
164                                 this.timeTaken = ((endTime - startTime) / 1000).toString();
165                                 this.showMoreVert = true;
166                                 this.errorMessage = '';
167                                 this.error = false;
168                             }
169                         }
170                     });
171             }
172         } else {
173         }
174         if (this.initialQueryString !== this.queryString && this.initCounter > 0 && this.hitCnt !== this.runButtonHitCnt) {
175             this.runButtonHitCnt = this.hitCnt;
176             this.initialQueryString = this.queryString;
177             this.initialProcesses();
178         } else {
179             this.runButtonHitCnt = this.hitCnt;
180         }
181
182     }
183
184     ngOnInit() {
185         this.dataSource.paginator = this.paginator;
186         this.dataSource.sort = this.sort;
187         this.dataSource.data = this.displayedRowObj;
188         this.initialProcesses();
189         this.errorMessage = '';
190         this.error = false;
191     }
192
193     initialProcesses() {
194         if (this.DashboardReportObj.length > 0) {
195             this.dashboard = this.DashboardReportObj;
196             this.options = {
197                 gridType: GridType.ScrollVertical,
198                 margin: 10,
199                 outerMargin: true,
200                 outerMarginTop: 10,
201                 outerMarginRight: 10,
202                 outerMarginBottom: 5000,
203                 outerMarginLeft: 10,
204                 scrollSensitivity: 10,
205                 scrollSpeed: 20,
206                 emptyCellDragMaxCols: null,
207                 emptyCellDragMaxRows: null,
208                 ignoreContentClass: 'gridster-item-content',
209                 enableOccupiedCellDrop: true,
210                 ignoreMarginInRow: false,
211                 draggable: {
212                     enabled: true,
213                 },
214                 resizable: {
215                     enabled: true,
216                 },
217                 swap: true,
218                 pushItems: true,
219                 disablePushOnDrag: false,
220                 disablePushOnResize: false,
221                 pushDirections: {north: true, east: true, south: true, west: true},
222                 pushResizeItems: true,
223                 disableWindowResize: true,
224                 disableWarnings: false,
225                 scrollToNewItems: true,
226                 enableDropToAdd: true,
227                 enableEmptyCellDrop: true,
228                 minCols: 2,
229                 minRows: 2,
230             };
231             this._runService.getDashboardReportFormFields(this.inputReportId)
232             .subscribe((dashboardFormFields) => {
233                 this.download_in_progress = true;
234                 this._runService.runDashboardReport(this.inputReportId, this.queryString)
235                     .subscribe((runDashboardReportResp) => {
236                     });
237                 this.download_in_progress = false;
238             });
239
240
241             this.showDashboardReport = true;
242
243         }
244         this.hitCnt = this.runButtonHitCnt;
245         this.initialQueryString = this.queryString;
246         this.initCounter++;
247
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) {
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/run', reportID, queryParameters]);
453     }
454
455
456     linkToFeedback(feedBackId: string, queryParameters: string) {
457         this._router.navigate(['v2/feedback', feedBackId]);
458     }
459
460     linkToMail(mailId: string) {
461         const email = 'mailto:' + mailId;
462         window.location.href = email;
463     }
464
465     openOptions() {
466         this.openOptionsFlag = !this.openOptionsFlag;
467     }
468
469     downloadReport(contentType: string, extension: string) {
470
471         if (this.showDashboardReport === false) {
472             this.download_in_progress = true;
473             this._runService.downloadReport(this.inputReportId, extension)
474                 .subscribe((responseExcel) => {
475
476                     this.downLoadFile(responseExcel, contentType, extension, '');
477                     this.download_in_progress = false;
478                 });
479         } else {
480             this._runService.getDashboardReportFormFields(this.inputReportId)
481                 .subscribe((dashboardFormFields) => {
482                     this.download_in_progress = true;
483                     this._runService.runDashboardReport(this.inputReportId, this.queryString)
484                         .subscribe((runDashboardReportResp) => {
485                             this._runService.downloadDashboardReportExcel(this.inputReportId)
486                                 .subscribe((responseDownloadDashboardReport) => {
487                                     this.downLoadFile(responseDownloadDashboardReport, contentType, extension, 'Dashboard');
488                                 });
489                         });
490                     this.download_in_progress = false;
491                 });
492         }
493     }
494
495     downloadSinglePage(contentType: string, extension: string) {
496         this.download_in_progress = true;
497         this._runService.downloadSinglePageReport(this.inputReportId, extension)
498             .subscribe((responseExcel) => {
499
500                 this.downLoadFile(responseExcel, contentType, extension, '');
501                 this.download_in_progress = false;
502             });
503     }
504
505     downLoadFile(data: any, type: string, extension: string, reportType: string) {
506         const blob = new Blob([data], {type: type});
507         const dt = new Date();
508         const utcDate = dt.getTime();
509         let fileName = this.reportName + utcDate + '.' + extension;
510         if (reportType === 'Dashboard') {
511             fileName = '';
512             fileName = reportType + '-' + this.inputReportId + '.' + extension;
513         }
514         if (window.navigator.msSaveOrOpenBlob) {
515             window.navigator.msSaveBlob(blob, fileName);
516         } else {
517             const anchor = window.document.createElement('a');
518             anchor.href = window.URL.createObjectURL(blob);
519             anchor.download = fileName;
520             document.body.appendChild(anchor);
521             anchor.click();
522             document.body.removeChild(anchor);
523             window.URL.revokeObjectURL(anchor.href);
524         }
525     }
526
527     applyFilter(filterValue: string) {
528         this.dataSource.data = this.displayedRowObj;
529         this.dataSource.sort = this.sort;
530         if (filterValue === '' || filterValue === null) {
531         } else {
532             this.dataSource.filter = filterValue.trim().toLowerCase();
533         }
534     }
535
536     setStyle(styles: string) {
537         if (styles.includes('{')) {
538             return JSON.parse(styles);
539         } else {
540             return {};
541         }
542     }
543
544     getDisplayTotal(keys: string) {
545         if (this.displayTotal.length > 0) {
546             return this.displayTotal[0][keys].displayValue;
547         } else {
548             return '';
549         }
550     }
551
552     onPaginationChange(event: any) {
553         if (this.DashboardReportObj.length === 0) {
554             if (this.reportMode === 'Regular' && this.initCnt === 0) {
555                 this.showMoreVert = false;
556                 this.displayedColumnsArr = [];
557                 this.displayedRowObj = [];
558                 this.displayedColumns = [];
559                 this.formFieldList = [];
560                 this.showSpinner = true;
561                 this.isReady = false;
562                 this.NEWdisplayedColumns = [];
563                 this.isChartAvailable = false;
564                 this.timeTaken = '...';
565                 const startDate: Date = new Date();
566                 const startTime = startDate.getTime();
567                 this._runService.getReportDataWithPageNo(this.inputReportId, event.pagenum)
568                     .subscribe((response) => {
569                         if (response['errormessage']) {
570                             this.showError(response);
571                         } else {
572                             const endDate: Date = new Date();
573                             const endTime = endDate.getTime();
574                             this.timeTaken = ((endTime - startTime) / 1000).toString();
575                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
576                                 this.inputReportId + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
577                             this.postFetchingReportDataFn(response, true);
578                             this.showMoreVert = true;
579                         }
580                     });
581             } else {
582                 this.showMoreVert = false;
583                 this.displayedColumnsArr = [];
584                 this.displayedRowObj = [];
585                 this.displayedColumns = [];
586                 this.formFieldList = [];
587                 this.showSpinner = true;
588                 this.isReady = false;
589                 this.NEWdisplayedColumns = [];
590                 this.isChartAvailable = false;
591                 this.timeTaken = '...';
592                 const startDate: Date = new Date();
593                 const startTime = startDate.getTime();
594                 this._runService.getReportDataWithFormFieldsWithPageNo(this.queryString, this.inputReportId, event.pageIndex)
595                     .subscribe((response) => {
596                         if (response['errormessage']) {
597                             this.showError(response);
598                         } else {
599                             const endDate: Date = new Date();
600                             const endTime = endDate.getTime();
601                             this.timeTaken = ((endTime - startTime) / 1000).toString();
602                             this.chartRunUrl = environment.baseUrl + 'raptor.htm?action=chart.run&c_master=' +
603                                 this.inputReportId + this.queryString + '&refresh=Y&display_content=Y&r_page=' + event.pagenum;
604                             this.postFetchingReportDataFn(response, true);
605                             this.showMoreVert = true;
606                         }
607                     });
608             }
609         } else {
610             this.showMoreVert = true;
611             this.showSpinner = false;
612         }
613         this.errorMessage = '';
614         this.error = false;
615         this.initCnt = 1;
616     }
617
618     convertToLinkToReport(value: string) {
619         value = value.replace(/;/g, '');
620         let outPut = '';
621         while (value.includes('c_master=')) {
622             const index = value.indexOf('c_master=');
623             if (index > 0) {
624                 value = value.substring(index, value.length);
625             } else if (index === 0) {
626                 value = value.replace('c_master=', '');
627             }
628         }
629         const split = value.split('&');
630         // const spltFirst = split[0].split('=');
631         if (split[1].length <= 0) {
632             return outPut;
633         }
634         outPut = 'linkToReport,' + split[0] + ',';
635         let splitCounter = 1;
636         for (splitCounter = 1; splitCounter < split.length; splitCounter++) {
637             if (!split[splitCounter].includes('LOGIN_ID=') &&
638                 !split[splitCounter].includes('display_content=') &&
639                 !split[splitCounter].includes('drilldown_index=') &&
640                 !split[splitCounter].includes('show_back_btn=') &&
641                 !split[splitCounter].includes('r_action')) {
642                 outPut = outPut + '&' + split[splitCounter];
643             }
644         }
645         return outPut;
646     }
647
648
649
650     takeToReport(queryString: string, reportID: string) {
651         this._router.navigate(['v2/run', reportID, queryString , this.groupSelectValue]);
652     }
653
654     goBack() {
655         const length = sessionStorage.length;
656         let repId = '';
657         let queryString = '';
658         if (length > 1) {
659             let split = [];
660             split = sessionStorage.getItem((length).toString()).split('|');
661             repId = split[0];
662             queryString = split[1];
663             sessionStorage.removeItem((length).toString());
664         } else if (length === 1) {
665             let split = [];
666             split = sessionStorage.getItem('1').split('|');
667             repId = split[0];
668             queryString = split[1];
669             sessionStorage.removeItem('1');
670         }
671         localStorage.removeItem(this.inputReportId);
672         this._router.navigate(['v2/run', repId, queryString]);
673     }
674
675 }
676