diff --git a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/ICrosstabConstants.java b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/ICrosstabConstants.java index 18977895fc3..da780fdebd4 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/ICrosstabConstants.java +++ b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/ICrosstabConstants.java @@ -128,11 +128,28 @@ public interface ICrosstabConstants String COLUMN_PAGE_BREAK_INTERVAL_PROP = "columnPageBreakInterval"; //$NON-NLS-1$ /** - * Name of the hide detail property. Value can be either row or column. + * Name of the hide detail property. Value can be either + * {@link #HIDE_DETAIL_ROW} or #{@link HIDE_DETAIL_COLUMN}. * * @since 4.6 */ String HIDE_DETAIL_PROP = "hideDetail";//$NON-NLS-1$ + + /** + * The value of hide detail property. It means all cells of row dimensions, + * measures and grand total in row direction will be hidden. + * + * @since 4.6 + */ + String HIDE_DETAIL_ROW = "row";//$NON-NLS-1$ + + /** + * The value of hide detail property. It means all cells of column + * dimensions, measures and grand total in column direction will be hidden. + * + * @since 4.6 + */ + String HIDE_DETAIL_COLUMN = "column";//$NON-NLS-1$ /** * Aggregation location constants. diff --git a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/i18n/nls.properties b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/i18n/nls.properties index 9f13873ee32..d0a40a68644 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/i18n/nls.properties +++ b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/i18n/nls.properties @@ -147,6 +147,7 @@ CrosstabReportItemTask.msg.pivot.crosstab=Pivot Crosstab CrosstabReportItemHandle.Error.HasNoCube=The Cross Tab must be able to access one cube. CrosstabReportItemHandle.log.validate=validating(...) +CrosstabReportItemPreparation.Exception.HideDetailPropertyValueIsWrong=The value of property "{0}" should be either "{1}" or "{2}". CrosstabScriptHandler.error.javascript={0} at line {1} of JavaScript:\r\n{2}\r\n CrosstabScriptHandler.info.try.register.crosstab.javascript.content=Try registering crosstab javascript content... diff --git a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/re/CrosstabReportItemPreparation.java b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/re/CrosstabReportItemPreparation.java index 159a8f290fb..84b7d9a30bb 100644 --- a/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/re/CrosstabReportItemPreparation.java +++ b/xtab/org.eclipse.birt.report.item.crosstab.core/src/org/eclipse/birt/report/item/crosstab/core/re/CrosstabReportItemPreparation.java @@ -13,6 +13,7 @@ import org.eclipse.birt.core.exception.BirtException; import org.eclipse.birt.report.engine.extension.ReportItemPreparationBase; +import org.eclipse.birt.report.item.crosstab.core.CrosstabException; import org.eclipse.birt.report.item.crosstab.core.ICrosstabConstants; import org.eclipse.birt.report.item.crosstab.core.ICrosstabReportItemConstants; import org.eclipse.birt.report.item.crosstab.core.de.AggregationCellHandle; @@ -21,6 +22,7 @@ import org.eclipse.birt.report.item.crosstab.core.de.DimensionViewHandle; import org.eclipse.birt.report.item.crosstab.core.de.LevelViewHandle; import org.eclipse.birt.report.item.crosstab.core.de.MeasureViewHandle; +import org.eclipse.birt.report.item.crosstab.core.i18n.Messages; import org.eclipse.birt.report.item.crosstab.core.script.internal.handler.CrosstabPreparationHandler; import org.eclipse.birt.report.model.api.DesignElementHandle; import org.eclipse.birt.report.model.api.ExtendedItemHandle; @@ -56,8 +58,26 @@ public void prepare( ) throws BirtException .getProperty( ICrosstabConstants.HIDE_DETAIL_PROP ); if ( hideDetail != null ) { - hideDetail( crosstab, - hideDetail.toString( ).toLowerCase( ).equals( "row" ) ); //$NON-NLS-1$ + if ( hideDetail.toString( ).toLowerCase( ).equals( + ICrosstabConstants.HIDE_DETAIL_ROW ) ) + { + hideDetail( crosstab, true ); + } + else if ( hideDetail.toString( ).toLowerCase( ).equals( + ICrosstabConstants.HIDE_DETAIL_COLUMN ) ) + { + hideDetail( crosstab, false ); + } + else + { + throw new CrosstabException( Messages.getString( + "CrosstabReportItemPreparation.Exception.HideDetailPropertyValueIsWrong", //$NON-NLS-1$ + new String[]{ + ICrosstabConstants.HIDE_DETAIL_PROP, + ICrosstabConstants.HIDE_DETAIL_ROW, + ICrosstabConstants.HIDE_DETAIL_COLUMN + } ) ); + } } ExtendedItemHandle modelHandle = (ExtendedItemHandle) crosstab