Subtotal Coloring On The Matrix - Bug?
May 29, 2007I have a matrix with both row and column subtotaling. The matrix also has alternating row coloring, which is done using a hidden static row group.
In addition to the alternating row coloing, I'm trying to color the subtotal cells. Using the InScope function I can determine whether the cell is in the Row Group or the Column group or neither.
The problem I'm having is with the coloring of the cells in the Row subtotals. My function correctly determines the appropriate color for each cell in the row total, but the column total cell coloring seems to supercede the color I'm setting on the row total.
Included is the RDL for the AdventureWorks CompanySales report, which I've modified to demonstrate my problem. I've added columns which basically indicate the current scope and the color I'm trying to set for each item in the matrix.
If anyone knows what I'm missing and how to correct this, I'd appreciate the help.
Code Snippet
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<DataSources>
<DataSource Name="AdventureWorks">
<DataSourceReference>AdventureWorks</DataSourceReference>
<rd:DataSourceID>25d3314c-0d4f-49cc-9c22-10194e825490</rd:DataSourceID>
</DataSource>
</DataSources>
<BottomMargin>0.5in</BottomMargin>
<RightMargin>0.5in</RightMargin>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>8.5in</InteractiveWidth>
<rd:GridSpacing>0.0625in</rd:GridSpacing>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ReportItems>
<Textbox Name="Title">
<Left>0.0625in</Left>
<Top>0.0625in</Top>
<ZIndex>1</ZIndex>
<Width>3.125in</Width>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontWeight>800</FontWeight>
<FontSize>18pt</FontSize>
<Color>DarkSlateBlue</Color>
</Style>
<Height>0.9375in</Height>
<Value>Adventure Works
2002 - 2003
Sales</Value>
</Textbox>
<Matrix Name="SalesMatrix">
<MatrixColumns>
<MatrixColumn>
<Width>0.875in</Width>
</MatrixColumn>
<MatrixColumn>
<Width>0.75in</Width>
</MatrixColumn>
<MatrixColumn>
<Width>0.4375in</Width>
</MatrixColumn>
<MatrixColumn>
<Width>0.625in</Width>
</MatrixColumn>
</MatrixColumns>
<Left>0.0625in</Left>
<RowGroupings>
<RowGrouping>
<Width>1.125in</Width>
<DynamicRows>
<ReportItems>
<Textbox Name="Category">
<ZIndex>7</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>Silver</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value>=Fields!ProdCat.Value</Value>
</Textbox>
</ReportItems>
<Sorting>
<SortBy>
<SortExpression>=Fields!ProdCat.Value</SortExpression>
<Direction>Descending</Direction>
</SortBy>
</Sorting>
<Grouping Name="ProductCategory">
<GroupExpressions>
<GroupExpression>=Fields!ProdCat.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicRows>
</RowGrouping>
<RowGrouping>
<Width>1.125in</Width>
<DynamicRows>
<ReportItems>
<Textbox Name="SubCategory">
<ZIndex>6</ZIndex>
<ToggleImage>
<InitialState>true</InitialState>
</ToggleImage>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>Silver</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value>=Fields!SubCat.Value</Value>
</Textbox>
</ReportItems>
<Subtotal>
<ReportItems>
<Textbox Name="textbox2">
<rd:DefaultName>textbox2</rd:DefaultName>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>#0066cc</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>Total</Value>
</Textbox>
</ReportItems>
</Subtotal>
<Sorting>
<SortBy>
<SortExpression>=Fields!SubCat.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Grouping Name="ProductSubcategory">
<GroupExpressions>
<GroupExpression>=Fields!SubCat.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicRows>
</RowGrouping>
<RowGrouping>
<Width>0.0625in</Width>
<DynamicRows>
<ReportItems>
<Textbox Name="txtAltColor">
<ZIndex>5</ZIndex>
<Visibility>
<Hidden>true</Hidden>
</Visibility>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Arial Black</FontFamily>
<FontSize>1pt</FontSize>
<BackgroundColor>=Value</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>=iif(RunningValue(Fields!SubCat.Value,CountDistinct,Nothing) Mod 2, "#C0C0C0", "White")</Value>
</Textbox>
</ReportItems>
<Grouping Name="AltColorRowGroup">
<GroupExpressions>
<GroupExpression>=1</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicRows>
</RowGrouping>
</RowGroupings>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<ReportItems>
<Textbox Name="OrderYear">
<ZIndex>13</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Left</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value>=Fields!OrderYear.Value</Value>
</Textbox>
</ReportItems>
<Subtotal>
<ReportItems>
<Textbox Name="textbox3">
<rd:DefaultName>textbox3</rd:DefaultName>
<ZIndex>12</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>Total</Value>
</Textbox>
</ReportItems>
</Subtotal>
<Sorting>
<SortBy>
<SortExpression>=Fields!OrderYear.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<Grouping Name="OrderYear">
<GroupExpressions>
<GroupExpression>=Fields!OrderYear.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</DynamicColumns>
<Height>0.25in</Height>
</ColumnGrouping>
<ColumnGrouping>
<Height>0.25in</Height>
<StaticColumns>
<StaticColumn>
<ReportItems>
<Textbox Name="textbox4">
<rd:DefaultName>textbox4</rd:DefaultName>
<ZIndex>11</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>Sales</Value>
</Textbox>
</ReportItems>
</StaticColumn>
<StaticColumn>
<ReportItems>
<Textbox Name="textbox5">
<rd:DefaultName>textbox5</rd:DefaultName>
<ZIndex>10</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>8pt</FontSize>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>Product Subcategory Scope</Value>
</Textbox>
</ReportItems>
</StaticColumn>
<StaticColumn>
<ReportItems>
<Textbox Name="textbox7">
<rd:DefaultName>textbox7</rd:DefaultName>
<ZIndex>9</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>8pt</FontSize>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>Order Year Scope</Value>
</Textbox>
</ReportItems>
</StaticColumn>
<StaticColumn>
<ReportItems>
<Textbox Name="textbox9">
<rd:DefaultName>textbox9</rd:DefaultName>
<ZIndex>8</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<TextAlign>Right</TextAlign>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>8pt</FontSize>
<BackgroundColor>SteelBlue</BackgroundColor>
<Color>White</Color>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>BG Color from expression</Value>
</Textbox>
</ReportItems>
</StaticColumn>
</StaticColumns>
</ColumnGrouping>
</ColumnGroupings>
<DataSetName>Sales</DataSetName>
<Top>1.0625in</Top>
<Width>7.6875in</Width>
<Corner>
<ReportItems>
<Textbox Name="textbox1">
<ZIndex>14</ZIndex>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value />
</Textbox>
</ReportItems>
</Corner>
<MatrixRows>
<MatrixRow>
<Height>0.25in</Height>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="Sales">
<ZIndex>4</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>9pt</FontSize>
<Format>C0</Format>
<BackgroundColor>=Code.MatrixColor(InScope("ProductSubcategory"), InScope("OrderYear"), ReportItems!txtAltColor.Value, "#0066CC")</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
</Style>
<Value>=Sum(Fields!Sales.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox6">
<rd:DefaultName>textbox6</rd:DefaultName>
<ZIndex>3</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>7pt</FontSize>
<Format>C0</Format>
<BackgroundColor>=Code.MatrixColor(InScope("ProductSubcategory"), InScope("OrderYear"), ReportItems!txtAltColor.Value, "#0066CC")</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>=InScope("ProductSubcategory")</Value>
</Textbox>
</ReportItems>
</MatrixCell>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox8">
<rd:DefaultName>textbox8</rd:DefaultName>
<ZIndex>2</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>7pt</FontSize>
<Format>C0</Format>
<BackgroundColor>=Code.MatrixColor(InScope("ProductSubcategory"), InScope("OrderYear"), ReportItems!txtAltColor.Value, "#0066CC")</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>=InScope("OrderYear")</Value>
</Textbox>
</ReportItems>
</MatrixCell>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox10">
<rd:DefaultName>textbox10</rd:DefaultName>
<ZIndex>1</ZIndex>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<FontSize>7pt</FontSize>
<Format>C0</Format>
<BackgroundColor>=Code.MatrixColor(InScope("ProductSubcategory"), InScope("OrderYear"), ReportItems!txtAltColor.Value, "#0066CC")</BackgroundColor>
<PaddingRight>2pt</PaddingRight>
</Style>
<CanGrow>true</CanGrow>
<Value>=Code.MatrixColor(InScope("ProductSubcategory"), InScope("OrderYear"), ReportItems!txtAltColor.Value, "#0066CC")</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
</MatrixRow>
</MatrixRows>
</Matrix>
</ReportItems>
<Height>2.0625in</Height>
<Style>
<BackgroundImage>
<Value>logoback</Value>
<Source>Embedded</Source>
</BackgroundImage>
</Style>
</Body>
<rd:ReportID>312657d4-5053-4f4c-b4fa-c580a92fd43b</rd:ReportID>
<LeftMargin>0.5in</LeftMargin>
<EmbeddedImages>
<EmbeddedImage Name="logoback">
<ImageData>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADCAbYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoo
ooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAEJxWHdazJ5pWAKFHGSMk1tsNykeoxXI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RRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUU
UAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH/2Q==</ImageData>
<MIMEType>image/jpeg</MIMEType>
</EmbeddedImage>
</EmbeddedImages>
<DataSets>
<DataSet Name="Sales">
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>SET DATEFORMAT mdy
SELECT PC.Name AS ProdCat, PS.Name AS SubCat, DATEPART(yy, SOH.OrderDate) AS OrderYear, 'Q' + DATENAME(qq, SOH.OrderDate) AS OrderQtr,
SUM(SOD.UnitPrice * SOD.OrderQty) AS Sales
FROM Production.ProductSubcategory PS INNER JOIN
Sales.SalesOrderHeader SOH INNER JOIN
Sales.SalesOrderDetail SOD ON SOH.SalesOrderID = SOD.SalesOrderID INNER JOIN
Production.Product P ON SOD.ProductID = P.ProductID ON PS.ProductSubcategoryID = P.ProductSubcategoryID INNER JOIN
Production.ProductCategory PC ON PS.ProductCategoryID = PC.ProductCategoryID
WHERE (SOH.OrderDate BETWEEN '1/1/2002' AND '12/31/2003')
GROUP BY DATEPART(yy, SOH.OrderDate), PC.Name, PS.Name, 'Q' + DATENAME(qq, SOH.OrderDate), PS.ProductSubcategoryID</CommandText>
<Timeout>30</Timeout>
<DataSourceName>AdventureWorks</DataSourceName>
</Query>
<Fields>
<Field Name="ProdCat">
<rd:TypeName>System.String</rd:TypeName>
<DataField>ProdCat</DataField>
</Field>
<Field Name="SubCat">
<rd:TypeName>System.String</rd:TypeName>
<DataField>SubCat</DataField>
</Field>
<Field Name="OrderYear">
<rd:TypeName>System.Int32</rd:TypeName>
<DataField>OrderYear</DataField>
</Field>
<Field Name="OrderQtr">
<rd:TypeName>System.String</rd:TypeName>
<DataField>OrderQtr</DataField>
</Field>
<Field Name="Sales">
<rd:TypeName>System.Decimal</rd:TypeName>
<DataField>Sales</DataField>
</Field>
</Fields>
</DataSet>
</DataSets>
<Code>public function MatrixColor(bRowGroupScope as Boolean, bColGroupScope as Boolean, sAltColor as string, sTotalColor as string) As String
Dim sReturn as String
Select Case True
Case (Not bRowGroupScope And Not bColGroupScope)
sReturn = sTotalColor
Case (bRowGroupScope And Not bColGroupScope)
sReturn = sAltColor
Case (Not bRowGroupScope And bColGroupScope)
sReturn = sTotalColor
Case (bRowGroupScope And bColGroupScope)
sReturn = sAltColor
End Select
MatrixColor = sReturn
end function</Code>
<Width>9.375in</Width>
<InteractiveHeight>11in</InteractiveHeight>
<Description>Adventure Works sales by quarter and product category. This report illustrates the use of a matrix data region that provides drilldown from summary data into detail data by showing and hiding rows. This report also illustrates the use of background images.</Description>
<TopMargin>0.5in</TopMargin>
</Report>