-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0000619: Add year in Indicators export monthly table #16
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,8 @@ private void createDetailSheet(final IndicatorDTO indicator) { | |
int rowIndex = -1; | ||
|
||
final List<PivotTableData.Axis> leaves = data.getEntryMap().get(indicator.getId()).getRootColumn().getLeaves(); | ||
final List<PivotTableData.Axis> leavesyear=data.getEntryMap().get(indicator.getId()+1).getRootColumn().getLeaves(); | ||
|
||
int numbOfLeaves = leaves.size(); | ||
int numbOfCols = 4; | ||
|
||
|
@@ -207,17 +209,74 @@ private void createDetailSheet(final IndicatorDTO indicator) { | |
sheetEx.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 1, numbOfCols)); | ||
|
||
// data entry | ||
//for year above months in indicators | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @manishvishnoi2 : This needs an indentation fix before the pull request can be merged. |
||
int startval=2; | ||
int endval=0; | ||
String merge="hello"; | ||
row = sheetEx.createRow(++rowIndex); | ||
row.setHeightInPoints(defHeight); | ||
int cellIndex = 0; | ||
utils.putHeader(row,++cellIndex, "Year"); | ||
Map<String, Integer> columnIndexMapyr=new HashMap<String, Integer>(); | ||
for(PivotTableData.Axis axis:leavesyear){ | ||
utils.putHeader(row,++cellIndex, axis.getLabel()); | ||
columnIndexMapyr.put(axis.getLabel(),cellIndex); | ||
if(cellIndex>3){ | ||
if(merge.equals(axis.getLabel())){ | ||
|
||
} | ||
else{ | ||
endval=cellIndex-1; | ||
sheetEx.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, startval, endval)); | ||
startval=cellIndex; | ||
} | ||
} | ||
sheetEx.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, startval, cellIndex)); | ||
merge=axis.getLabel(); | ||
|
||
} | ||
// header | ||
int month=0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @manishvishnoi2 : This needs an indentation fix before the pull request can be merged. |
||
String completedate="hello"; | ||
row = sheetEx.createRow(++rowIndex); | ||
row.setHeightInPoints(defHeight); | ||
int cellIndex = 0; | ||
utils.putHeader(row, ++cellIndex, data.getLocalizedVersion("sideAndMonth")); | ||
cellIndex = 0; | ||
utils.putHeader(row,++cellIndex, "month"); | ||
Map<String, Integer> columnIndexMap = new HashMap<String, Integer>(); | ||
for (PivotTableData.Axis axis : leaves) { | ||
utils.putHeader(row, ++cellIndex, axis.getLabel()); | ||
columnIndexMap.put(axis.getLabel(), cellIndex); | ||
if(cellIndex==2){ | ||
completedate=axis.getLabel(); | ||
} | ||
} | ||
|
||
if(completedate.equals("Jan")){month=1;} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @manishvishnoi2 : This needs an indentation fix before the pull request can be merged. |
||
else if(completedate.equals("Feb")){month=2;} | ||
else if(completedate.equals("Mar")){month=3;} | ||
else if(completedate.equals("Apr")){month=4;} | ||
else if(completedate.equals("May")){month=5;} | ||
else if(completedate.equals("Jun")){month=6;} | ||
else if(completedate.equals("Jul")){month=7;} | ||
else if(completedate.equals("Aug")){month=8;} | ||
else if(completedate.equals("Sep")){month=9;} | ||
else if(completedate.equals("Oct")){month=10;} | ||
else if(completedate.equals("Nov")){month=11;} | ||
else{month=12;} | ||
|
||
|
||
//for year row in sheet | ||
row = sheetEx.createRow(++rowIndex); | ||
row.setHeightInPoints(defHeight); | ||
cellIndex = 0; | ||
utils.putHeader(row,++cellIndex, "Site"); | ||
Map<String, Integer> columnIndexMapcompletedate=new HashMap<String, Integer>(); | ||
for(PivotTableData.Axis axis:leavesyear){ | ||
utils.putHeader(row,++cellIndex, month+"."+ axis.getLabel()); | ||
columnIndexMapcompletedate.put(axis.getLabel(),cellIndex); | ||
if(month==12){ | ||
month=1; | ||
}else{month++;} | ||
} | ||
// rows | ||
for (PivotTableData.Axis axis : data.getEntryMap().get(indicator.getId()).getRootRow().getChildren()) { | ||
row = sheetEx.createRow(++rowIndex); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manishvishnoi2 : This needs an indentation fix before the pull request can be merged.