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 5005211f833..f34a8fc8384 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 @@ -103,14 +103,10 @@ private void hideDetail( CrosstabReportItemHandle crosstab, for ( MeasureViewHandle mv : crosstab.getAllMeasures( ) ) { AggregationCellHandle cell = mv.getCell( ); - cell.getModelHandle( ).setProperty( hideRow - ? IStyleModel.HEIGHT_PROP : IStyleModel.WIDTH_PROP, - ZERO ); - // If hiding row, have to remove all items in the measure cell and - // grand total cell if ( hideRow ) { + // Remove all items in the measure cell and grand total cell clearCellContents( cell ); clearCellContents( mv.getAggregationCell( cell.getDimensionName( @@ -119,11 +115,16 @@ private void hideDetail( CrosstabReportItemHandle crosstab, null, null ) ); } + else + { + cell.getModelHandle( ).setProperty( IStyleModel.WIDTH_PROP, + ZERO ); + } } - // If hiding row, have to remove all items in the dimension cell if ( hideRow ) { + // Remove all items in the dimension cell int dimCount = crosstab .getDimensionCount( ICrosstabConstants.ROW_AXIS_TYPE ); for ( int i = 0; i < dimCount; i++ ) @@ -136,6 +137,11 @@ private void hideDetail( CrosstabReportItemHandle crosstab, clearCellContents( level.getCell( ) ); } } + + // Hide measure header to avoid meaningless header + handle.setProperty( + ICrosstabReportItemConstants.HIDE_MEASURE_HEADER_PROP, + true ); } // Set big pageBreakInterval to avoid page break @@ -145,18 +151,11 @@ private void hideDetail( CrosstabReportItemHandle crosstab, : ICrosstabConstants.COLUMN_PAGE_BREAK_INTERVAL_PROP, NO_PAGE_BREAK ); - // If hiding row, hide measure header to avoid meaningless header - if ( hideRow ) - { - handle.setProperty( - ICrosstabReportItemConstants.HIDE_MEASURE_HEADER_PROP, - true ); - } - // Fixed Layout to avoid white space ( (ReportDesignHandle) crosstab.getModuleHandle( ) ) .setLayoutPreference( DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT ); + } private void clearCellContents( CrosstabCellHandle cell ) @@ -188,13 +187,14 @@ private void clearCellContents( CrosstabCellHandle cell ) ZERO ); cell.getModelHandle( ).setProperty( IStyleModel.PADDING_RIGHT_PROP, ZERO ); - // No contents for ( Object child : cell.getContents( ) ) { if ( child instanceof DesignElementHandle ) { - ( (DesignElementHandle) child ).dropAndClear( ); + DesignElementHandle designElement = (DesignElementHandle) child; + designElement.setProperty( IStyleModel.DISPLAY_PROP, + DesignChoiceConstants.DISPLAY_NONE ); } } }