たとえば、次の例に示すように、CurrencyFormatter フォーマッターを OLAPDataGrid コントロールに適用します。
<mx:CurrencyFormatter id="usdFormatter" precision="2" currencySymbol="$" decimalSeparatorFrom="." decimalSeparatorTo="." useNegativeSign="true" useThousandsSeparator="true" alignSymbol="left"/> ... <mx:OLAPDataGrid id="myOLAPDG" width="100%" height="100%"> <mx:itemRendererProviders> <mx:OLAPDataGridItemRendererProvider uniqueName="[QuarterDim].[Quarter]" type="{OLAPDataGrid.OLAP_HIERARCHY}" formatter="{usdFormatter}"/> </mx:itemRendererProviders> </mx:OLAPDataGrid>
この例では、
コンポーネントをアイテムレンダラーとして使う場合、
OLAPDataGrid コントロール内の各セルは、コントロールの行に沿ったメンバーと列に沿ったメンバーの間の交差領域になります。 ただし、アイテムレンダラーを OLAPDataGrid コントロールに割り当てる場合は、行と列のいずれかの次元の
2 つ以上のアイテムレンダラーの間で競合が発生した場合、OLAPDataGrid コントロールは次の優先度に基づいてアイテムレンダラーを適用します。
したがって、type の値が
2 つのアイテムレンダラーの type プロパティの値が同じ場合、OLAPDataGrid コントロールはアイテムにより近いレンダラーを判別し、そのレンダラーを適用します。
たとえば、アプリケーションで次のスタイルを定義し、
<Style> .monthStyle { color:0x755762 fontSize:14 } </Style> <mx:ODGHeaderRendererProvider type="OLAPDataGrid.OLAP_HIERARCHY" uniqueName="[Time][Month]" styleName="monthStyle"/>
OLAPDataGrid コントロールに対してカスタムヘッダーレンダラーを指定するには、OLAPDataGridHeaderRenderer クラスのサブクラスとしてカスタムヘッダーレンダラーを作成し、OLAPDataGridHeaderRendererProvider のインスタンスを作成ます。次に