1

マトリックス コントロールでは、列を「サイズ」でグループ化し、次に「色」でグループ化します。結果のテーブルは次のようになります。

デフォルトのグループ化

ヘッダー行を反転する必要があるため、テーブルは次のようになります。

グループ化

子グループの値は、親グループの対応する値のに表示される必要があります。

4

1 に答える 1

0

おそらく、親グループをサイズと色の両方を組み合わせたグループにすることで、色のみを表示し、次に子/サブグループのサイズでグループ化します。

アップデート:

わかりましたので、小さなデータセットを作成しました。データセットがあなたが取り戻しているようなものかどうかはわかりませんが、レポートで必要なものを取得するために SQL でデータを操作する方法について、他のアイデアに拍車がかかる可能性があります.

最初に、一連の SELECT ... UNION ALL ステートメントを作成しましたが、いじくり回した後も、必要な視覚的出力/グループ化に近いものを得ることができませんでした。だからここに私が使ったものがあります:

with CTE (Color, Size, CSGroup, Amt) As (
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size,'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size, 'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size, 'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all

select 'Yellow' As color, 'Small' as size, 'YellowSmall' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Small' as size, 'YellowSmall' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Medium' as size, 'YellowMedium' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Medium' as size, 'YellowMedium' as CSGroup ,1 as Amt union all

select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Small' as size, 'BlueSmall' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Large' as size, 'BlueLarge' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Large' as size, 'BlueLarge' as CSGroup, 1 as Amt union all

select 'Green' As color, 'Medium' as size, 'GreenMedium' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Medium' as size, 'GreenMedium' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Small' as size, 'GreenSmall' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Small' as size, 'GreenSmall' as CSGroup, 1 as Amt)
Select Color, Size, SUM(Amt) As Amount From CTE group by Color, Size

CSGroup最終的に使用しなかったのは無視してかまいません。

これで、データセットに必要なものの「外観」がわかりました。

マトリックスを作成し、サイズと色でグループ化しました ( =Fields!size.Value & Fields!color.Value)

次にグループを挿入し、サイズ ( =Fields!size.Value)でグループ化

私が持っている「トップ」列のグループ化=Fields!color.Value

私が持っている2番目の列のグループ化で=First(Fields!Size.Value)

私が持っているデータテキストボックスに=Sum(Fields!Amount.Value)

次に、2 番目の列グループを右クリックし、[重複を非表示] ボックスをオンにします。次にDataset1、ドロップダウンで選択しました。

私ができなかった唯一のことは、テキストボックスをマージできなかったため、サイズを中央に配置することでした。

グループ化の例

于 2010-10-11T13:27:34.347 に答える