Thursday, March 22, 2012
Conditionally hiding values in a Matrix
I have a matrix which has a runningvalue in it's detail cell, so it looks
like this:
item, date1, date2, date3...datex
A, 1, 1, 1...1
B, 1, 2, 3...x
C, 1, 2, -1...y
D, 1, -2, -3...z
This works fine and all is well. However, I now wish to filter out all rows
that have no negative values (which in the above example will only leave C
and D). Since the runningvalues themselves are not in the dataset, is there
any way of basing a whole row's visibility or inclusion based on any value
in the detail cell?
If not could you suggest how I could do this?
Thanks!
ShakShak,
I've had this issue, I found that a stored procedure which works it out
before hand is the only feasible solution. Create a temporary table
containing rows for item A, B, C etc, and a flag to say whether they
have negatives. Then in the SP still, do the normal query but join the
temporary table on item so you can include the flag in the output.
Then you can suppress a row based on the the first flag at that level
using =First(Field!Flag.Value) in the groups filters, or more
efficiently you could remove it from within the SP.
Chris
Shak wrote:
> Hi all,
> I have a matrix which has a runningvalue in it's detail cell, so it
> looks like this:
> item, date1, date2, date3...datex
> A, 1, 1, 1...1
> B, 1, 2, 3...x
> C, 1, 2, -1...y
> D, 1, -2, -3...z
> This works fine and all is well. However, I now wish to filter out
> all rows that have no negative values (which in the above example
> will only leave C and D). Since the runningvalues themselves are not
> in the dataset, is there any way of basing a whole row's visibility
> or inclusion based on any value in the detail cell?
> If not could you suggest how I could do this?
> Thanks!
> Shak|||Hi Chris,
While waiting for a reply, that was the solution I worked on. It seems
precalculation is the only way to solve it, which is a shame - some kind of
"two pass" reporting generation might be complicated though.
My solution was slightly different in that I flag all rows with and ID that
may at any time have a runningvalue less than zero; it's then just easy to
filter the dataset on that flag when required.
Thanks for the reply though!
Shak
"Chris McGuigan" <chris.mcguigan@.zycko.com> wrote in message
news:ubjeuVocFHA.2960@.TK2MSFTNGP09.phx.gbl...
> Shak,
> I've had this issue, I found that a stored procedure which works it out
> before hand is the only feasible solution. Create a temporary table
> containing rows for item A, B, C etc, and a flag to say whether they
> have negatives. Then in the SP still, do the normal query but join the
> temporary table on item so you can include the flag in the output.
> Then you can suppress a row based on the the first flag at that level
> using =First(Field!Flag.Value) in the groups filters, or more
> efficiently you could remove it from within the SP.
> Chris
>
> Shak wrote:
> > Hi all,
> >
> > I have a matrix which has a runningvalue in it's detail cell, so it
> > looks like this:
> >
> > item, date1, date2, date3...datex
> > A, 1, 1, 1...1
> > B, 1, 2, 3...x
> > C, 1, 2, -1...y
> > D, 1, -2, -3...z
> >
> > This works fine and all is well. However, I now wish to filter out
> > all rows that have no negative values (which in the above example
> > will only leave C and D). Since the runningvalues themselves are not
> > in the dataset, is there any way of basing a whole row's visibility
> > or inclusion based on any value in the detail cell?
> >
> > If not could you suggest how I could do this?
> >
> > Thanks!
> >
> > Shak
>
Conditionally hiding column in matrix
Date
Month RowGroup1 Group2 Amount
I have month in the rows because I want to page on month when
exporting to excel in order to produce a new sheet. This seem to work
ok except for the following.
1. I'm passing in a date range (7/1/2004 - 8/31/2004) When the report
is displayed, I correctly get a report paged by month but the date
column shows all date between 7/1 and 8/31 on both sheets, regardless
of having a value in the amount field. So for July all August dates
are displayed and for July all August values are displayed. Can I
hide dates where the amount is null or missing?
2. When I export to excel the individual sheets are called sheet1,
sheet2... Is there a way to give the name of each sheet the
corresponding month value?
Thanks for your assistance?
DaveRather than putting the month in the matrix, put the matrix in a list which
groups by month.
You cannot control the Excel sheet names in the current version.
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Dave" <davidbr93@.yahoo.com> wrote in message
news:703390f1.0408311012.2310ed6f@.posting.google.com...
> I have a matrix with the following format
> Date
> Month RowGroup1 Group2 Amount
>
> I have month in the rows because I want to page on month when
> exporting to excel in order to produce a new sheet. This seem to work
> ok except for the following.
>
> 1. I'm passing in a date range (7/1/2004 - 8/31/2004) When the report
> is displayed, I correctly get a report paged by month but the date
> column shows all date between 7/1 and 8/31 on both sheets, regardless
> of having a value in the amount field. So for July all August dates
> are displayed and for July all August values are displayed. Can I
> hide dates where the amount is null or missing?
> 2. When I export to excel the individual sheets are called sheet1,
> sheet2... Is there a way to give the name of each sheet the
> corresponding month value?
> Thanks for your assistance?
> Dave
Conditionally hide 2 out of 6 rows in a matrix?
I just spent about 30mins searching through the forums for this and saw several posts, but I didn't find a straight answer that seems like it would work for my report. How can I add only 2 data rows to a group (to hide them via the group's visible properties) and keep the rest of the rows outside of the group, but still in the same column (vertical area), as shown:
This is the view of all rows:
And this is the view I'm seeking in some cases:
This question is not clear to me. So, do you want to hide two rows from each group? If so does it have to be any specific rows. If this is what you want then I think you can do this with ROWCOUNT
|||Each Data line that I have added is for a separate field from the dataset window and I need specific fields hidden, but if it makes things more workable for changing visibility, I could go by the row number on which that they are located (although I doubt [data] row number is an accessible value).
|||
Sorry, I meant to say RowNumber in my last post and instead I said RowCount. You might be able to do this with RowNumber(). This will give you the rownumber of the dataset. CountRows() will give you the total rows within the group.
See if you can use CountRows() and RowNumber() and develop a logic based on what you need.
|||It's not as simple as that because setting a row visibility hidden to true would just blank out the row and leave white space, and the only way I see to group the data to toggle group visibility would be to stuff all data pieces into the same group. Suggestions have been given to put the data you want to hide into a group, but that may only work to hide data pieces to the right of some other data (which would be in a separate group). As far as I can see, that won't allow me to get the result I've pictured above in my first post.
Conditionally format subtotal for matrix report
I have a matrix that will pull out the current quarters sales figures. I want to change the color of the subtotal font ONLY when we are in the current period. I have a boolean field in the matrix report that is true when it is the current month.
For example, at the end of last month it displays January, February and March figures. I want the sub total to display the totals for January and February in white, whilst the totals for March are Yellow.
Any ideas anyone?
You can use expression for the subtotal style. Just check the value of your bool field in the expression, and return the corresponding color.|||Unfortunately, that doesn't work.
I am using a condition in the color field of the subtotal properties checking the boolean value - and it ALWAYS thinks that the value is true, whether it is or not. Problem is that I have a mixture in my matrix - the previous 2 months hold false, the current month true and I am displaying all 3 months.
I am using the following in the color field in the properties of the subtotal:
=IIf(Fields!CurrentPeriod.Value, "Yellow", "White")
And it is showing yellow for all months.
Any pointers greatfully received
|||Hi there,Did you find an answer to this? I am stuck with the same problem.
-Thanks a lot|||
Hi Ragas, Just try like this add your expression in differen place.Click in textbox and go to properties window,go to back ground color in that drop down list add your expression.
|||Hi folks,
I have tried various methods for conditional formating in subtotal. Everything is working in development environment, but when i deploy and see the report in the http://ReportServer/reports, it is not being implemented. But when i print from the report from report server, i can see the conditional format !!!!
Can anyone give solution for this?
Regards,
karthik
|||Hi there,
This worked for me:
=iif(inscope("Rating_Group") and inscope("RowRating_Group"),"white","Gainsboro")
Use in any of the attributes (Font, Color, Borderstyl) of the Data cell, in other words the cells that will contain the values of the matrix.
"Rating_Group" and "RowRating_Group" simply represent the Group which the subtotal belongs to. I had two subtotals on my report that's why I used both.
This can be a column group or a row group.
You should be able to format the subtotals to your heart's content with this beaut.
Tuesday, March 20, 2012
Conditionally format subtotal for matrix report
I have a matrix that will pull out the current quarters sales figures. I want to change the color of the subtotal font ONLY when we are in the current period. I have a boolean field in the matrix report that is true when it is the current month.
For example, at the end of last month it displays January, February and March figures. I want the sub total to display the totals for January and February in white, whilst the totals for March are Yellow.
Any ideas anyone?
You can use expression for the subtotal style. Just check the value of your bool field in the expression, and return the corresponding color.|||Unfortunately, that doesn't work.
I am using a condition in the color field of the subtotal properties checking the boolean value - and it ALWAYS thinks that the value is true, whether it is or not. Problem is that I have a mixture in my matrix - the previous 2 months hold false, the current month true and I am displaying all 3 months.
I am using the following in the color field in the properties of the subtotal:
=IIf(Fields!CurrentPeriod.Value, "Yellow", "White")
And it is showing yellow for all months.
Any pointers greatfully received
|||Hi there,Did you find an answer to this? I am stuck with the same problem.
-Thanks a lot|||
Hi Ragas, Just try like this add your expression in differen place.Click in textbox and go to properties window,go to back ground color in that drop down list add your expression.
|||Hi folks,
I have tried various methods for conditional formating in subtotal. Everything is working in development environment, but when i deploy and see the report in the http://ReportServer/reports, it is not being implemented. But when i print from the report from report server, i can see the conditional format !!!!
Can anyone give solution for this?
Regards,
karthik
|||Hi there,
This worked for me:
=iif(inscope("Rating_Group") and inscope("RowRating_Group"),"white","Gainsboro")
Use in any of the attributes (Font, Color, Borderstyl) of the Data cell, in other words the cells that will contain the values of the matrix.
"Rating_Group" and "RowRating_Group" simply represent the Group which the subtotal belongs to. I had two subtotals on my report that's why I used both.
This can be a column group or a row group.
You should be able to format the subtotals to your heart's content with this beaut.
Conditionally format subtotal for matrix report
I have a matrix that will pull out the current quarters sales figures. I want to change the color of the subtotal font ONLY when we are in the current period. I have a boolean field in the matrix report that is true when it is the current month.
For example, at the end of last month it displays January, February and March figures. I want the sub total to display the totals for January and February in white, whilst the totals for March are Yellow.
Any ideas anyone?
You can use expression for the subtotal style. Just check the value of your bool field in the expression, and return the corresponding color.|||Unfortunately, that doesn't work.
I am using a condition in the color field of the subtotal properties checking the boolean value - and it ALWAYS thinks that the value is true, whether it is or not. Problem is that I have a mixture in my matrix - the previous 2 months hold false, the current month true and I am displaying all 3 months.
I am using the following in the color field in the properties of the subtotal:
=IIf(Fields!CurrentPeriod.Value, "Yellow", "White")
And it is showing yellow for all months.
Any pointers greatfully received
|||Hi there,Did you find an answer to this? I am stuck with the same problem.
-Thanks a lot|||
Hi Ragas, Just try like this add your expression in differen place.Click in textbox and go to properties window,go to back ground color in that drop down list add your expression.
|||Hi folks,
I have tried various methods for conditional formating in subtotal. Everything is working in development environment, but when i deploy and see the report in the http://ReportServer/reports, it is not being implemented. But when i print from the report from report server, i can see the conditional format !!!!
Can anyone give solution for this?
Regards,
karthik
|||Hi there,
This worked for me:
=iif(inscope("Rating_Group") and inscope("RowRating_Group"),"white","Gainsboro")
Use in any of the attributes (Font, Color, Borderstyl) of the Data cell, in other words the cells that will contain the values of the matrix.
"Rating_Group" and "RowRating_Group" simply represent the Group which the subtotal belongs to. I had two subtotals on my report that's why I used both.
This can be a column group or a row group.
You should be able to format the subtotals to your heart's content with this beaut.
Conditionally format subtotal for matrix report
I have a matrix that will pull out the current quarters sales figures. I want to change the color of the subtotal font ONLY when we are in the current period. I have a boolean field in the matrix report that is true when it is the current month.
For example, at the end of last month it displays January, February and March figures. I want the sub total to display the totals for January and February in white, whilst the totals for March are Yellow.
Any ideas anyone?
You can use expression for the subtotal style. Just check the value of your bool field in the expression, and return the corresponding color.|||Unfortunately, that doesn't work.
I am using a condition in the color field of the subtotal properties checking the boolean value - and it ALWAYS thinks that the value is true, whether it is or not. Problem is that I have a mixture in my matrix - the previous 2 months hold false, the current month true and I am displaying all 3 months.
I am using the following in the color field in the properties of the subtotal:
=IIf(Fields!CurrentPeriod.Value, "Yellow", "White")
And it is showing yellow for all months.
Any pointers greatfully received
|||Hi there,Did you find an answer to this? I am stuck with the same problem.
-Thanks a lot|||
Hi Ragas, Just try like this add your expression in differen place.Click in textbox and go to properties window,go to back ground color in that drop down list add your expression.
|||Hi folks,
I have tried various methods for conditional formating in subtotal. Everything is working in development environment, but when i deploy and see the report in the http://ReportServer/reports, it is not being implemented. But when i print from the report from report server, i can see the conditional format !!!!
Can anyone give solution for this?
Regards,
karthik
|||Hi there,
This worked for me:
=iif(inscope("Rating_Group") and inscope("RowRating_Group"),"white","Gainsboro")
Use in any of the attributes (Font, Color, Borderstyl) of the Data cell, in other words the cells that will contain the values of the matrix.
"Rating_Group" and "RowRating_Group" simply represent the Group which the subtotal belongs to. I had two subtotals on my report that's why I used both.
This can be a column group or a row group.
You should be able to format the subtotals to your heart's content with this beaut.
sqlsqlMonday, March 19, 2012
Conditional totals for matrix report
row header has that value.
agent air hotel cruise
-- -- -- --
bob 1 1
jim 1
jane 1 1
What I want is a total at the bottom of the report counting the numbe of
ones in the column. I am very new to SSRS as a whole, so please help!!
Thanks in advance!Carl,
Right click on the data row cell and click on "subtotals". Thats it you
have column totals.
--Venkat
Carl Henthorn wrote:
> I have a matrix report that has the value of one (1) in the row field when my
> row header has that value.
> agent air hotel cruise
> -- -- -- --
> bob 1 1
> jim 1
> jane 1 1
> What I want is a total at the bottom of the report counting the numbe of
> ones in the column. I am very new to SSRS as a whole, so please help!!
> Thanks in advance!|||Thank you for responding. I have tried the right click method, but the cell
that I need the subtotals on does not have "Subtotal" on the menu. Is there
some other way?
Thanks!
"venkat.oar@.gmail.com" wrote:
> Carl,
> Right click on the data row cell and click on "subtotals". Thats it you
> have column totals.
> --Venkat
> Carl Henthorn wrote:
> > I have a matrix report that has the value of one (1) in the row field when my
> > row header has that value.
> >
> > agent air hotel cruise
> > -- -- -- --
> > bob 1 1
> > jim 1
> > jane 1 1
> >
> > What I want is a total at the bottom of the report counting the numbe of
> > ones in the column. I am very new to SSRS as a whole, so please help!!
> > Thanks in advance!
>|||If possible pls send me the rdl file.. i will work on it and send it to
u back..
Carl Henthorn wrote:
> Thank you for responding. I have tried the right click method, but the cell
> that I need the subtotals on does not have "Subtotal" on the menu. Is there
> some other way?
> Thanks!
>
> "venkat.oar@.gmail.com" wrote:
> > Carl,
> >
> > Right click on the data row cell and click on "subtotals". Thats it you
> > have column totals.
> >
> > --Venkat
> > Carl Henthorn wrote:
> > > I have a matrix report that has the value of one (1) in the row field when my
> > > row header has that value.
> > >
> > > agent air hotel cruise
> > > -- -- -- --
> > > bob 1 1
> > > jim 1
> > > jane 1 1
> > >
> > > What I want is a total at the bottom of the report counting the numbe of
> > > ones in the column. I am very new to SSRS as a whole, so please help!!
> > > Thanks in advance!
> >
> >
Sunday, March 11, 2012
Conditional row formatting in matrix
=iif(RowNumber("matrix1_columngroupscope") Mod 2,"Blue","White")
to format the rows. But the problem occurs in that the color does not change if the cell is null (e.g. not entry in the data set). For columns that are fully populated, I get the correct result. If columns that are not, I don't.virtualfergy wrote:
> Sorry if I'm being daft, but you said "attached report". How do I
> view the attachment?
You need to have OE for this or a news reader able to deal with attachment.
If you don't have this pls. find the GreenBar sample code below. Copy and
paste it into your *.rdl
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Matrix Name="matrix1">
<Corner>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</Corner>
<Height>0.5in</Height>
<Style />
<MatrixRows>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="Qty">
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=ReportItems!Color.Value</BackgroundColor>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>Qty</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Sum(Fields!Qty.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.25in</Height>
</MatrixRow>
</MatrixRows>
<MatrixColumns>
<MatrixColumn>
<Width>0.875in</Width>
</MatrixColumn>
</MatrixColumns>
<DataSetName>DataSet1</DataSetName>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<Grouping Name="Category">
<GroupExpressions>
<GroupExpression>=Fields!CategoryName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="CategoryName">
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<TextAlign>Right</TextAlign>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>CategoryName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!CategoryName.Value</Value>
</Textbox>
</ReportItems>
</DynamicColumns>
<Height>0.25in</Height>
</ColumnGrouping>
</ColumnGroupings>
<Width>2in</Width>
<Top>0.125in</Top>
<Left>0.125in</Left>
<RowGroupings>
<RowGrouping>
<DynamicRows>
<Grouping Name="Country">
<GroupExpressions>
<GroupExpression>=Fields!Country.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="Country">
<Style>
<BorderStyle>
<Default>Solid</Default>
<Right>None</Right>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothin
g) Mod 2, "AliceBlue", "White")</BackgroundColor>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>Country</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Country.Value & " " &
RunningValue(Fields!Country.Value,CountDistinct,Nothing)</Value>
</Textbox>
</ReportItems>
</DynamicRows>
<Width>1in</Width>
</RowGrouping>
<RowGrouping>
<DynamicRows>
<Grouping Name="Count">
<GroupExpressions>
<GroupExpression>=1</GroupExpression>
</GroupExpressions>
</Grouping>
<ReportItems>
<Textbox Name="Color">
<Style>
<BorderStyle>
<Default>Solid</Default>
<Left>None</Left>
</BorderStyle>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=Value</BackgroundColor>
<FontSize>1pt</FontSize>
<Color>=Value</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<CanGrow>true</CanGrow>
<Value>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing) Mod 2,
"AliceBlue", "White")</Value>
</Textbox>
</ReportItems>
</DynamicRows>
<Width>0.125in</Width>
</RowGrouping>
</RowGroupings>
</Matrix>
</ReportItems>
<Style />
<Height>3.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>26f1bf87-1fa6-4e77-8d1a-81b0cd940403</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=.;initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Code />
<Width>6.875in</Width>
<DataSets>
<DataSet Name="DataSet1">
<Fields>
<Field Name="Country">
<DataField>Country</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Qty">
<DataField>Qty</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="CategoryName">
<DataField>CategoryName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT Customers.Country, SUM([Order
Details].Quantity) AS Qty, Categories.CategoryName
FROM Customers INNER JOIN
Orders ON Customers.CustomerID = Orders.CustomerID
INNER JOIN
[Order Details] ON Orders.OrderID = [Order
Details].OrderID INNER JOIN
Products ON [Order Details].ProductID =Products.ProductID INNER JOIN
Categories ON Products.CategoryID =Categories.CategoryID
GROUP BY Customers.Country, Categories.CategoryName</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<Description />
<rd:ReportID>ab2c120b-3169-427d-8ad6-b8716f8c5101</rd:ReportID>
<BottomMargin>1in</BottomMargin>
</Report>|||Whoa... that worked but what a convoluted way to make it happen. I hope you folks at MS make this simpler in the future. Thanks for the help.
"Roland" wrote:
> virtualfergy wrote:
> > Sorry if I'm being daft, but you said "attached report". How do I
> > view the attachment?
> You need to have OE for this or a news reader able to deal with attachment.
> If you don't have this pls. find the GreenBar sample code below. Copy and
> paste it into your *.rdl
> <?xml version="1.0" encoding="utf-8"?>
> <Report
> xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
> tion"
> xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
> <RightMargin>1in</RightMargin>
> <Body>
> <ReportItems>
> <Matrix Name="matrix1">
> <Corner>
> <ReportItems>
> <Textbox Name="textbox1">
> <Style>
> <BorderStyle>
> <Default>Solid</Default>
> </BorderStyle>
> <PaddingLeft>2pt</PaddingLeft>
> <PaddingBottom>2pt</PaddingBottom>
> <PaddingTop>2pt</PaddingTop>
> <PaddingRight>2pt</PaddingRight>
> </Style>
> <ZIndex>4</ZIndex>
> <rd:DefaultName>textbox1</rd:DefaultName>
> <CanGrow>true</CanGrow>
> <Value />
> </Textbox>
> </ReportItems>
> </Corner>
> <Height>0.5in</Height>
> <Style />
> <MatrixRows>
> <MatrixRow>
> <MatrixCells>
> <MatrixCell>
> <ReportItems>
> <Textbox Name="Qty">
> <Style>
> <BorderStyle>
> <Default>Solid</Default>
> </BorderStyle>
> <PaddingLeft>2pt</PaddingLeft>
> <BackgroundColor>=ReportItems!Color.Value</BackgroundColor>
> <TextAlign>Right</TextAlign>
> <PaddingBottom>2pt</PaddingBottom>
> <PaddingTop>2pt</PaddingTop>
> <PaddingRight>2pt</PaddingRight>
> </Style>
> <rd:DefaultName>Qty</rd:DefaultName>
> <CanGrow>true</CanGrow>
> <Value>=Sum(Fields!Qty.Value)</Value>
> </Textbox>
> </ReportItems>
> </MatrixCell>
> </MatrixCells>
> <Height>0.25in</Height>
> </MatrixRow>
> </MatrixRows>
> <MatrixColumns>
> <MatrixColumn>
> <Width>0.875in</Width>
> </MatrixColumn>
> </MatrixColumns>
> <DataSetName>DataSet1</DataSetName>
> <ColumnGroupings>
> <ColumnGrouping>
> <DynamicColumns>
> <Grouping Name="Category">
> <GroupExpressions>
> <GroupExpression>=Fields!CategoryName.Value</GroupExpression>
> </GroupExpressions>
> </Grouping>
> <ReportItems>
> <Textbox Name="CategoryName">
> <Style>
> <BorderStyle>
> <Default>Solid</Default>
> </BorderStyle>
> <PaddingLeft>2pt</PaddingLeft>
> <TextAlign>Right</TextAlign>
> <PaddingBottom>2pt</PaddingBottom>
> <PaddingTop>2pt</PaddingTop>
> <PaddingRight>2pt</PaddingRight>
> </Style>
> <ZIndex>3</ZIndex>
> <rd:DefaultName>CategoryName</rd:DefaultName>
> <CanGrow>true</CanGrow>
> <Value>=Fields!CategoryName.Value</Value>
> </Textbox>
> </ReportItems>
> </DynamicColumns>
> <Height>0.25in</Height>
> </ColumnGrouping>
> </ColumnGroupings>
> <Width>2in</Width>
> <Top>0.125in</Top>
> <Left>0.125in</Left>
> <RowGroupings>
> <RowGrouping>
> <DynamicRows>
> <Grouping Name="Country">
> <GroupExpressions>
> <GroupExpression>=Fields!Country.Value</GroupExpression>
> </GroupExpressions>
> </Grouping>
> <ReportItems>
> <Textbox Name="Country">
> <Style>
> <BorderStyle>
> <Default>Solid</Default>
> <Right>None</Right>
> </BorderStyle>
> <PaddingLeft>2pt</PaddingLeft>
> <BackgroundColor>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothin
> g) Mod 2, "AliceBlue", "White")</BackgroundColor>
> <PaddingBottom>2pt</PaddingBottom>
> <PaddingTop>2pt</PaddingTop>
> <PaddingRight>2pt</PaddingRight>
> </Style>
> <ZIndex>2</ZIndex>
> <rd:DefaultName>Country</rd:DefaultName>
> <CanGrow>true</CanGrow>
> <Value>=Fields!Country.Value & " " &
> RunningValue(Fields!Country.Value,CountDistinct,Nothing)</Value>
> </Textbox>
> </ReportItems>
> </DynamicRows>
> <Width>1in</Width>
> </RowGrouping>
> <RowGrouping>
> <DynamicRows>
> <Grouping Name="Count">
> <GroupExpressions>
> <GroupExpression>=1</GroupExpression>
> </GroupExpressions>
> </Grouping>
> <ReportItems>
> <Textbox Name="Color">
> <Style>
> <BorderStyle>
> <Default>Solid</Default>
> <Left>None</Left>
> </BorderStyle>
> <PaddingLeft>2pt</PaddingLeft>
> <BackgroundColor>=Value</BackgroundColor>
> <FontSize>1pt</FontSize>
> <Color>=Value</Color>
> <PaddingBottom>2pt</PaddingBottom>
> <PaddingTop>2pt</PaddingTop>
> <PaddingRight>2pt</PaddingRight>
> </Style>
> <ZIndex>1</ZIndex>
> <CanGrow>true</CanGrow>
> <Value>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing) Mod 2,
> "AliceBlue", "White")</Value>
> </Textbox>
> </ReportItems>
> </DynamicRows>
> <Width>0.125in</Width>
> </RowGrouping>
> </RowGroupings>
> </Matrix>
> </ReportItems>
> <Style />
> <Height>3.25in</Height>
> </Body>
> <TopMargin>1in</TopMargin>
> <DataSources>
> <DataSource Name="Northwind">
> <rd:DataSourceID>26f1bf87-1fa6-4e77-8d1a-81b0cd940403</rd:DataSourceID>
> <ConnectionProperties>
> <DataProvider>SQL</DataProvider>
> <ConnectString>data source=.;initial
> catalog=Northwind</ConnectString>
> <IntegratedSecurity>true</IntegratedSecurity>
> </ConnectionProperties>
> </DataSource>
> </DataSources>
> <Code />
> <Width>6.875in</Width>
> <DataSets>
> <DataSet Name="DataSet1">
> <Fields>
> <Field Name="Country">
> <DataField>Country</DataField>
> <rd:TypeName>System.String</rd:TypeName>
> </Field>
> <Field Name="Qty">
> <DataField>Qty</DataField>
> <rd:TypeName>System.Int32</rd:TypeName>
> </Field>
> <Field Name="CategoryName">
> <DataField>CategoryName</DataField>
> <rd:TypeName>System.String</rd:TypeName>
> </Field>
> </Fields>
> <Query>
> <DataSourceName>Northwind</DataSourceName>
> <CommandText>SELECT Customers.Country, SUM([Order
> Details].Quantity) AS Qty, Categories.CategoryName
> FROM Customers INNER JOIN
> Orders ON Customers.CustomerID = Orders.CustomerID
> INNER JOIN
> [Order Details] ON Orders.OrderID = [Order
> Details].OrderID INNER JOIN
> Products ON [Order Details].ProductID => Products.ProductID INNER JOIN
> Categories ON Products.CategoryID => Categories.CategoryID
> GROUP BY Customers.Country, Categories.CategoryName</CommandText>
> </Query>
> </DataSet>
> </DataSets>
> <LeftMargin>1in</LeftMargin>
> <rd:SnapToGrid>true</rd:SnapToGrid>
> <rd:DrawGrid>true</rd:DrawGrid>
> <Description />
> <rd:ReportID>ab2c120b-3169-427d-8ad6-b8716f8c5101</rd:ReportID>
> <BottomMargin>1in</BottomMargin>
> </Report>
>
>
>
>
>
Thursday, March 8, 2012
Conditional Matrix Subtotals
Fruit_name status count
apples Fresh 5
apples rotten 3
pears Fresh 3
pears rotten 2
and I was to matrix it and group on fruit_name and add a subtotal to count. In that subtotal, without changing what was displayed in the details number, could I conditionaly only show a sum of fresh fruit? Example below
Apples 5
Apples 3
-
Total 5
Pears 3
Pears 2
-
Total 3
in a nonmatrix situation I'd use something like
sum(iif(status="Fresh",count,0))
Thanks for the help.Anyone have any ideas? Or is it not possible to have have a conditional summation with components that aren't displayed in the matrix,|||
Hello,
Instead of doing this subtotal at the report level, can you try using the "RollUp" operator in the SQL statement..
Example :
select fruit_name, status, sum(Qty)
from tables........
group by fruit_name, status with rollup
DataResult:
Apples Fresh 5
Apples Rotten 3
Apples NULL 8
Pears Fresh 3
Pears Rotten 2
Pears NULL 5
NULL NULL 13
(you can replace NULL with ALL using the Grouping function )
I may not be answering to your question.. but maybe this will help you..
Thanks!
|||I considered making the summation another row of the dataset instead of calculating it in the report but I was hoping to have the matrix do it.I'll probably use the sql pivot function to pivot the data before it hits the report and use a table instead of a matrix.
Reporting Services is a decent product but it's missing some very basic features.
Wednesday, March 7, 2012
Conditional Formatting in a Matrix Control
Hi there.
I am creating a report that the requirements need different background colors based on the row or column as shown below:
I can get the row colors to work great with an expression, but when I try to add the gray column with conditional formatting for the Resident's Overall Satisfaction Rating question, it clobbers my row formatting. I am thinking that I will have to do some gnarly expression in each of the rows and columns using the InScope function. Does that sound about right, or is there an easier way?
Thanks, Mike
Actually, this was easy once I looked at it again. On the detail cell, I just added another condition that identified the column in question and set the color appropriately. Works great.
Sometimes it just takes another look!
- Mike
Conditional formatting for missing numeric data
currency. In cases where the data is missing, the empty cell displays "$".
If I use the iif() function for conditional formatting, it inserts the entire
expression into all of the cells. Does anyone know how I can format the
cells that do not contain any data so that nothing will be displayed?
thanks!It sounds like you need Nothing:
=iif(Fields!MyValue.Value Is Nothing,"","C0")
Put the expression in the Custom field in the Textbox Properties window.
I think you can use "". If not, choose something else.
"Anna" wrote:
> I created a matrix report which includes numeric data to be formatted as
> currency. In cases where the data is missing, the empty cell displays "$".
> If I use the iif() function for conditional formatting, it inserts the entire
> expression into all of the cells. Does anyone know how I can format the
> cells that do not contain any data so that nothing will be displayed?
> thanks!
Conditional Formatting
columns grouped by sales office.
I would like to conditionally format the b/g colour of the data
values so that if for example period 1 sales in 2007 were less than
period 1 sales in 2006, the b/g would be red.
I have done this in othjer reports but how can it be done in a
matrix table?
--
-- -- -- -
Posted with NewsLeecher v3.7 Final
Web @. http://www.newsleecher.com/?usenet
-- -- -- -- -On May 7, 5:54 am, Jason (j...@.junkiesplace.net) wrote:
> I have a matrix report that has rows grouped by year, by period, and
> columns grouped by sales office.
> I would like to conditionally format the b/g colour of the data
> values so that if for example period 1 sales in 2007 were less than
> period 1 sales in 2006, the b/g would be red.
> I have done this in othjer reports but how can it be done in a
> matrix table?
> --
> -- -- -- -
> Posted with NewsLeecher v3.7 Final
> Web @.http://www.newsleecher.com/?usenet
> -- -- -- -- -
The best way to manage this would be to set a flag column in the query/
stored procedure that is sourcing the report. Then if the sales are
lower for a later year, the LowerFlag column = 1 in the query. Then in
the report, on the Layout tab, select the cells that will be affected
by the background color change and in the Properties window next to
background color, enter in an expression something like:
=iif(Fields!LowerFlag.Value = 1, "Red", "White")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant
Conditional formating in Subtotals?
You have to put the background color expression directly on the matrix cell, similar to the approach described in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=648771&SiteID=1
-- Robert
|||That didn't work. I copied the example from the post and I set a different color for each of the three results. It set all the cells as "In Subtotal of entire matrix" color. The odd thing is, I also have a background image which shows up correctly in the preview, but the image doesn't show up when I render the report from a browser.|||if you are doing alot of testing, make sure to refresh the report in the browser from the view to the print view. I have found that SSRS cache's data and unless a refresh is done it can still show previous view data.
Weird.
|||We need more information.an iif statement will work, how are you computing the subtotals, is it in a group footer? if so something like
=iif( sum(fields!field.value) < Number, "Green", "Yellow")
should work...|||
Yes, I created the subtotals by right-clicking the row cell of the outer-most group and selecting 'subtotals'. The problem with the simple iif... is that it affects all the cells - not just the subtotals.
I did find out why my background image wasn't showing in the subtotals, if you set a background color in the Subtotal properties, it will overlay the background image from the cell properties.
|||I think the InScope solution may be the key to my problem, but for some reason, it isn't detecting the scope. Any ideas on what I've done wrong?|||Robert was right. The InScope works, but I needed to add the matrix name and underscore to the row and columns group names since I had more than one matrix in the report.
Thanks Robert!
Saturday, February 25, 2012
Conditional format within matrix, depending on subtotal?
I'm having trouble inserting a conditional format to a specific column.
e.g.: Matrix within the rows the "weeks" (1, 2, 3, ... , 52), and in the column a "lastyear revenu", "thisyear revenue" and a difference between them, "delta %", in percent grouped by the stores.
I added a subtotal to it so I get in the latest column the "total lastyear revenue", the "total thisyear revenue" and a difference between them in percent for all stores, "total delta %", for a specific week.
Problem: I want to colour the "delta %" column green when it is greater then the "total delta %" value.
I thougt this would be quite easy, but it really is a pain in the *** because, in the background expression dialog box, I can't refer to the subtotal cells ...
I tried to create a simple report from a cube with Month,Store,Turnover, Previous Year turnover and Delta %. Then I placed on the rows the months and the stores and the values in the colums (that should be the way that you did on the report, am I correct?) and I added the subtotal. Then in the background expression I wrote this:
"=iif(sum(Delta.values) > sum(Delta.values,"Dataset1"),"Green","White")"
Doing this I had the monthly delta background in green when it was higher than the total one.
I hope that I was clear enough!
|||So, am I getting this right:You simply created another dataset in which you calculate the "total delta %". You then refer in the background expression dialog box to the "total delta %" field of the new dataset?
|||
The dataset is the same, I just refer to the whole dataset in the formula.
So, I have only one dataset (dataset1) and in the % delta for the background I use a formula like:
iif((sum(Fields!CYRevenue.value)-sum(Fields!PYRevenue.value))/sum(fields!PYRevenue.value) > (sum(Fields!CYRevenue.value,"Dataset1")-sum(Fields!PYRevenue.value,"Dataset1"))/sum(fields!PYRevenue.value,"Dataset1"),"Green","White")
Hope it helps!
Conditional format within matrix, depending on subtotal?
I'm having trouble inserting a conditional format to a specific column.
e.g.: Matrix within the rows the "weeks" (1, 2, 3, ... , 52), and in the column a "lastyear revenu", "thisyear revenue" and a difference between them, "delta %", in percent grouped by the stores.
I added a subtotal to it so I get in the latest column the "total lastyear revenue", the "total thisyear revenue" and a difference between them in percent for all stores, "total delta %", for a specific week.
Problem: I want to colour the "delta %" column green when it is greater then the "total delta %" value.
I thougt this would be quite easy, but it really is a pain in the *** because, in the background expression dialog box, I can't refer to the subtotal cells ...
I tried to create a simple report from a cube with Month,Store,Turnover, Previous Year turnover and Delta %. Then I placed on the rows the months and the stores and the values in the colums (that should be the way that you did on the report, am I correct?) and I added the subtotal. Then in the background expression I wrote this:
"=iif(sum(Delta.values) > sum(Delta.values,"Dataset1"),"Green","White")"
Doing this I had the monthly delta background in green when it was higher than the total one.
I hope that I was clear enough!
|||So, am I getting this right:You simply created another dataset in which you calculate the "total delta %". You then refer in the background expression dialog box to the "total delta %" field of the new dataset?
|||
The dataset is the same, I just refer to the whole dataset in the formula.
So, I have only one dataset (dataset1) and in the % delta for the background I use a formula like:
iif((sum(Fields!CYRevenue.value)-sum(Fields!PYRevenue.value))/sum(fields!PYRevenue.value) > (sum(Fields!CYRevenue.value,"Dataset1")-sum(Fields!PYRevenue.value,"Dataset1"))/sum(fields!PYRevenue.value,"Dataset1"),"Green","White")
Hope it helps!
Conditional Count for Row Group together with Column Group
Total
=Fields!Division.Value
=Count(iif("Status"=Fields!Status.Value,1,0),"Division")
Total:
the above is the matrix that i had done to count some values. The
"=Fields!Status.Value" is a column group call Status and the
"=Fields!Division.Value" is a row group call Division. My column goup
contains 3 fields which are "Accepted", "Rejected" and "Pending" and my row
group contais all my division fields. My database had a record of all the
submissions that had been submitted by the different divisions and what is
their submission current status which is either Accepted, Rejected or Pending.
Now what i want to achieved is that i want to display the Number of
Accepted, Rejected and Pending submissions for each Division by using the
Count function. But the expression that i had did does not give me the actual
result. i need some help on what correct expression should i use.
Thansk in advance for all the help and time consumed.ok, managed to solve it with a simple expression =Count(Fields!Status.Value)
Thanks anyway. =)
"JiaN" wrote:
> Division =Fields!Status.Value
> Total
> =Fields!Division.Value
> =Count(iif("Status"=Fields!Status.Value,1,0),"Division")
> Total:
> the above is the matrix that i had done to count some values. The
> "=Fields!Status.Value" is a column group call Status and the
> "=Fields!Division.Value" is a row group call Division. My column goup
> contains 3 fields which are "Accepted", "Rejected" and "Pending" and my row
> group contais all my division fields. My database had a record of all the
> submissions that had been submitted by the different divisions and what is
> their submission current status which is either Accepted, Rejected or Pending.
> Now what i want to achieved is that i want to display the Number of
> Accepted, Rejected and Pending submissions for each Division by using the
> Count function. But the expression that i had did does not give me the actual
> result. i need some help on what correct expression should i use.
> Thansk in advance for all the help and time consumed.
Friday, February 24, 2012
Conditional Column Formatting
I am trying to hide a column in a matrix table. I have no
trouble using conditional formatting to control the visibility of the
column, but when I hide the column the main row in the matrix does not
shrink. Therefore, I have a big gap... My thought was to use conditional
formatting to control the column width of the main matrix row. Listed
below is the expression that I used. Can anyone help me with the error
message or recommend a better solution?
=IIF(Fields!FiscalYear.Value = IIF(Month(TODAY()) = 10-12,Year(TODAY()) ,Year(Today())-1), 0.625in, 0.25in) cannot be
parsed as a unit because it does not contain numeric values. Examples
of valid unit strings are "1pt" and ".5in".
Regards,
A.AkinPut double quotes around the "0.625in" and "0.25in"
"awakin" wrote:
> Hi Everyone,
>
> I am trying to hide a column in a matrix table. I have no
> trouble using conditional formatting to control the visibility of the
> column, but when I hide the column the main row in the matrix does not
> shrink. Therefore, I have a big gap... My thought was to use conditional
> formatting to control the column width of the main matrix row. Listed
> below is the expression that I used. Can anyone help me with the error
> message or recommend a better solution?
>
>
>
> =IIF(Fields!FiscalYear.Value = IIF(Month(TODAY()) => 10-12,Year(TODAY()) ,Year(Today())-1), 0.625in, 0.25in) cannot be
> parsed as a unit because it does not contain numeric values. Examples
> of valid unit strings are "1pt" and ".5in".
>
> Regards,
>
> A.Akin
>|||That doesn't help. It still gives the same error message.
Is there another way of doing this?
"Michael C" wrote:
> Put double quotes around the "0.625in" and "0.25in"
>
> "awakin" wrote:
> > Hi Everyone,
> >
> >
> >
> > I am trying to hide a column in a matrix table. I have no
> > trouble using conditional formatting to control the visibility of the
> > column, but when I hide the column the main row in the matrix does not
> > shrink. Therefore, I have a big gap... My thought was to use conditional
> > formatting to control the column width of the main matrix row. Listed
> > below is the expression that I used. Can anyone help me with the error
> > message or recommend a better solution?
> >
> >
> >
> >
> >
> >
> >
> > =IIF(Fields!FiscalYear.Value = IIF(Month(TODAY()) => > 10-12,Year(TODAY()) ,Year(Today())-1), 0.625in, 0.25in) cannot be
> > parsed as a unit because it does not contain numeric values. Examples
> > of valid unit strings are "1pt" and ".5in".
> >
> >
> >
> > Regards,
> >
> >
> >
> > A.Akin
> >
> >|||Anthoney,
Did you ever figure this out? I need to control the width of a column but
it appears column width isn't formattable via an expression.
thanks,
Justin
"AnthonyG" wrote:
> That doesn't help. It still gives the same error message.
> Is there another way of doing this?
> "Michael C" wrote:
> >
> > Put double quotes around the "0.625in" and "0.25in"
> >
> >
> > "awakin" wrote:
> >
> > > Hi Everyone,
> > >
> > >
> > >
> > > I am trying to hide a column in a matrix table. I have no
> > > trouble using conditional formatting to control the visibility of the
> > > column, but when I hide the column the main row in the matrix does not
> > > shrink. Therefore, I have a big gap... My thought was to use conditional
> > > formatting to control the column width of the main matrix row. Listed
> > > below is the expression that I used. Can anyone help me with the error
> > > message or recommend a better solution?
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > =IIF(Fields!FiscalYear.Value = IIF(Month(TODAY()) => > > 10-12,Year(TODAY()) ,Year(Today())-1), 0.625in, 0.25in) cannot be
> > > parsed as a unit because it does not contain numeric values. Examples
> > > of valid unit strings are "1pt" and ".5in".
> > >
> > >
> > >
> > > Regards,
> > >
> > >
> > >
> > > A.Akin
> > >
> > >
Conditional color in reports?
I'd like to be able to have type color change if a value is negative.
I'd like to be able to set the entire row's color based off of group code.
Can this be done, and how?
TIAYou can write an expression for the background color of the row.
Read this for more info:
http://msdn2.microsoft.com/en-us/library/ms159238.aspx
> I have reports in Grids and Matrix formats. They look ugly!
> I'd like to be able to have type color change if a value is negative.
> I'd like to be able to set the entire row's color based off of group
> code. Can this be done, and how?
> TIA
>
Condition in Subtotal?
I have the following matrix
CA AZ
No surplus 11 5
Surplus 12 10
Zotal 100 50
Totlal 123 65
I want that only (No surplus and Surplus) sum include in total Can I apply This condition on Subtotal.
thanks in advance
Hi Yaseen,
Take a look to this post. This will help you out.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1315844&SiteID=1
Bernard Ong