diff options
author | Sudarshan Kumar <sudarshan.kumar@att.com> | 2020-05-19 21:49:28 +0530 |
---|---|---|
committer | Sudarshan Kumar <sudarshan.kumar@att.com> | 2020-05-19 21:50:31 +0530 |
commit | a5f3b926d32cceab130096d0e3b687e0305c2059 (patch) | |
tree | 538aa4f10def2a9150e98141bb536e165b936ec7 /ecomp-sdk | |
parent | 2053ff0eaa2e4d1efcdb56a953af7c631757369e (diff) |
Setting reportTotalDataRows to reportJSONRuntime
Setting reportTotalDataRows to reportJSONRuntime
Issue-ID: PORTAL-902
Change-Id: If0fc12fe03872978e09d8de9a541065303602181
Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java index b6f944a7..29c5f3c1 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java @@ -2791,6 +2791,7 @@ public List getMapMarkers(ReportData rd, org.onap.portalsdk.analytics.xmlobj.Rep reportJSONRuntime.setTotalRows(getReportDataSize()); ArrayList<ColumnHeader> colList = new ArrayList<>(); ArrayList<Map<String,Object>> reportDataRows = new ArrayList<>(); + ArrayList<Map<String,Object>> reportTotalDataRows = new ArrayList<Map<String,Object>>(); for(rd.reportColumnHeaderRows.resetNext(); rd.reportColumnHeaderRows.hasNext(); ) { count++; ColumnHeaderRow chr = rd.reportColumnHeaderRows.getNext(); @@ -2815,10 +2816,27 @@ public List getMapMarkers(ReportData rd, org.onap.portalsdk.analytics.xmlobj.Rep reportDataRows.add(dvJSON); } } + if(rd.reportDataTotalRow != null) { + for(rd.reportDataTotalRow.resetNext(); rd.reportDataTotalRow.hasNext(); count++) { + dvJSON = new HashMap<String,Object>(); + DataRow dr = rd.reportDataTotalRow.getNext(); + for(dr.resetNext(); dr.hasNext(); ) { + DataValue dv = dr.getNext(); + try { + dvJSON.put(dv.getColId(), dv); + } catch (Exception ex) { + ex.printStackTrace(); + + } + } + reportTotalDataRows.add(dvJSON); + } + } reportJSONRuntime.setReportDataColumns(colList); reportJSONRuntime.setReportDataRows(reportDataRows); //reportJSONRuntime.setSqlWhole(getWholeSQL()); reportJSONRuntime.setPageSize(getPageSize()); + reportJSONRuntime.setReportTotalDataRows(reportTotalDataRows); } |