Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

0000619: Add year in Indicators export monthly table #16

wants to merge 2 commits into from

Conversation

manishvishnoi2
Copy link

Fixes 0000619 .

Example Screenshot :
Project_synthesis_20160311235041.xls.zip

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

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

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

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

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
2 participants