Skip to content

0000619: Add year in Indicators export monthly table#16

Open
manishvishnoi2 wants to merge 2 commits intosigmah-dev:masterfrom
manishvishnoi2:0000619
Open

0000619: Add year in Indicators export monthly table#16
manishvishnoi2 wants to merge 2 commits intosigmah-dev:masterfrom
manishvishnoi2:0000619

Conversation

@manishvishnoi2
Copy link
Copy Markdown

Fixes 0000619 .

Example Screenshot :
Project_synthesis_20160311235041.xls.zip

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();
Copy link
Copy Markdown
Member

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.

@manishvishnoi2
Copy link
Copy Markdown
Author

hello @spMohanty : After using format tool given by Netbeans on all of my code,the above changes were recorded.Please take a look and if those are not ok, Suggest me a method to perform correct formatting.
Thank You

month = 10;
} else if (completedate.equals("Nov")) {
month = 11;
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do it more safely, like

} else if (completeDate.equals("Dec")) {
    month = 12;
} else {
    throw new IllegalStateException("unable to parse " + completedate);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it's quite strange you do that manually, you should be using a date manipulation API (I guess, something like java.text.DateFormat).

@ghost
Copy link
Copy Markdown

ghost commented Apr 20, 2016

It seems that some code have been copy-pasted from IndicatorEntryCalcTemplate and IndicatorEntryExcelTemplate (at the first sight, the completeDate parsing...). @manishvishnoi2, can you reduce the duplication in the code you introduced? You may have to introduce common method somewhere...

month = 1;
} else {
month++;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A date manipulation API should do that kind of thing for you. You may have a look at something called lenient (see java.text.DateFormat#setLenient for example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants