summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-11-17 05:04:09 (EST)
committer mwu2011-11-17 05:04:09 (EST)
commit4652c4a0a24970f8dad61eeff4e48b93fa2434dc (patch)
treecfb18342e1a3244862bb4d6cc905b96fb1f1470f
parent5b0fc2804ef719bf96797229233bac7b0e20fdb3 (diff)
downloadorg.eclipse.birt-4652c4a0a24970f8dad61eeff4e48b93fa2434dc.zip
org.eclipse.birt-4652c4a0a24970f8dad61eeff4e48b93fa2434dc.tar.gz
org.eclipse.birt-4652c4a0a24970f8dad61eeff4e48b93fa2434dc.tar.bz2
support previous year, previous quarter, previous month in model adapter
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
index 9c22074..b0da96a 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/ModelAdapter.java
@@ -475,6 +475,18 @@ public class ModelAdapter implements IModelAdapter
{
baseTimePeriod = new TimePeriod( 0, TimePeriodType.QUARTER, true );
}
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_YEAR.equals( calculateType ) )
+ {
+ baseTimePeriod = new TimePeriod( 0, TimePeriodType.YEAR, true );
+ }
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_QUARTER.equals( calculateType ) )
+ {
+ baseTimePeriod = new TimePeriod( 0, TimePeriodType.QUARTER, true );
+ }
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_MONTH.equals( calculateType ) )
+ {
+ baseTimePeriod = new TimePeriod( 0, TimePeriodType.MONTH, true );
+ }
else if ( IBuildInBaseTimeFunction.CURRENT_MONTH.equals( calculateType ) )
{
baseTimePeriod = new TimePeriod( 0, TimePeriodType.MONTH, true );
@@ -624,7 +636,8 @@ public class ModelAdapter implements IModelAdapter
relativeTimePeriod = new TimePeriod( 0 - Integer.valueOf( n ),
TimePeriodType.YEAR );
}
- else if ( IBuildInBaseTimeFunction.PREVIOUS_MONTH_TO_DATE.equals( calculateType ) )
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_MONTH_TO_DATE.equals( calculateType )
+ || IBuildInBaseTimeFunction.PREVIOUS_MONTH.equals( calculateType ) )
{
Iterator iter = periodHandle.calculationArgumentsIterator( );
String n = null;
@@ -644,7 +657,8 @@ public class ModelAdapter implements IModelAdapter
relativeTimePeriod = new TimePeriod( 0 - Integer.valueOf( n ),
TimePeriodType.MONTH );
}
- else if ( IBuildInBaseTimeFunction.PREVIOUS_QUARTER_TO_DATE.equals( calculateType ) )
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_QUARTER_TO_DATE.equals( calculateType )
+ || IBuildInBaseTimeFunction.PREVIOUS_QUARTER.equals( calculateType ) )
{
Iterator iter = periodHandle.calculationArgumentsIterator( );
String n = null;
@@ -664,7 +678,8 @@ public class ModelAdapter implements IModelAdapter
relativeTimePeriod = new TimePeriod( 0 - Integer.valueOf( n ),
TimePeriodType.QUARTER );
}
- else if ( IBuildInBaseTimeFunction.PREVIOUS_YEAR_TO_DATE.equals( calculateType ) )
+ else if ( IBuildInBaseTimeFunction.PREVIOUS_YEAR_TO_DATE.equals( calculateType )
+ || IBuildInBaseTimeFunction.PREVIOUS_YEAR.equals( calculateType ) )
{
Iterator iter = periodHandle.calculationArgumentsIterator( );
String n = null;