Thursday, March 29, 2012
Alternating BackColor
I wand to use an Alternating Backcolor in a Report for every Row. In don't
find this property.
How can i do it?
Many thanks.
AndyHi,
There is no property to do this
Here is the post replied by Bruce Johnson [MSFT]
Hope this helps
At the end of this posting are two reports that demonstrate how to alternate
row colors on a table and a matrix.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Christian Larsen" <ChristianLarsen@.discussions.microsoft.com> wrote in
message news:608EB056-430E-44A2-AD02-1621CA41FC3F@.microsoft.com...
> Hi all.
> How do i get a different color on odd rows in a table or matrix?
> /Chrsitian
TableGreenBar.rdl
================================================================================<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Table Name="table1">
<Height>1in</Height>
<Style />
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>11</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Country</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>10</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Company Name</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>9</ZIndex>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Header>
<Details>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="CompanyName">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=iif(RowNumber(Nothing) Mod 2,
"PaleGreen", "White")</BackgroundColor>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>CompanyName</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!CompanyName.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox6">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox6</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Details>
<DataSetName>Northwind</DataSetName>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="Country">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<BackgroundColor>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing)
Mod 2, "Cornsilk", "White")</BackgroundColor>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>8</ZIndex>
<rd:DefaultName>Country</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Country.Value</Value>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox11">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>7</ZIndex>
<rd:DefaultName>textbox11</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox12">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>6</ZIndex>
<rd:DefaultName>textbox12</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<Grouping Name="CountryGroup">
<GroupExpressions>
<GroupExpression>=Fields!Country.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
<Footer>
<TableRows>
<TableRow>
<Height>0.25in</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox7</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox8">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>textbox8</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="textbox9">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox9</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
<TableColumns>
<TableColumn>
<Width>1.66667in</Width>
</TableColumn>
<TableColumn>
<Width>1.66667in</Width>
</TableColumn>
<TableColumn>
<Width>1.66667in</Width>
</TableColumn>
</TableColumns>
</Table>
</ReportItems>
<Style />
<Height>1.875in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>32d95cbf-5e5b-4fb3-a37a-39b9506b8c80</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=localhost;initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>5in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="CustomerID">
<DataField>CustomerID</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CompanyName">
<DataField>CompanyName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ContactName">
<DataField>ContactName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ContactTitle">
<DataField>ContactTitle</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Address">
<DataField>Address</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="City">
<DataField>City</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Region">
<DataField>Region</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="PostalCode">
<DataField>PostalCode</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Country">
<DataField>Country</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Phone">
<DataField>Phone</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Fax">
<DataField>Fax</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT *
FROM Customers</CommandText>
<Timeout>30</Timeout>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>4792d607-5639-4c89-ac36-2794e9e78a74</rd:ReportID>
<BottomMargin>1in</BottomMargin>
</Report>
MatrixGreenBar.rdl
================================================================================<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
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,Nothing)
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>
"Andreas Szabo" <Andreas.Szabo_PLEASE_INSERT_ADD_complementa.ch> wrote in
message news:O%23rS43yuEHA.2196@.TK2MSFTNGP14.phx.gbl...
> Hi
> I wand to use an Alternating Backcolor in a Report for every Row. In don't
> find this property.
> How can i do it?
> Many thanks.
> Andy
>
Alternate row in diffrerent colors
I wish to change the back colour for alternate rows in a report (say Table).
I haven't found anything that tells me the current-rownum. The RowNum seems
more like a row-count. Please help!!
Thanks in advance,
Regards,
DattaTo have alternating colours in a table, use this formula
=iif(RowNumber(Nothing) Mod 2, "Gainsboro", "White")
A slightly more refined version can be found in Adlai Maschiach's blog:
http://dotnetjunkies.com/WebLog/adlaim/archive/2004/08/29/23594.aspx
This is the way to do it if you want to control the alternating colours in a
table with groups, as the first one will not take groupings into
consideration.
To do it in a matrix, you need to do it like Chris Hays writes
http://blogs.msdn.com/chrishays/archive/2004/08/30/GreenBarMatrix.aspx
Kaisa M. Lindahl Lervik
"Datta" <Datta@.discussions.microsoft.com> wrote in message
news:5FC4A7F0-B950-4F0C-A726-D383AC381960@.microsoft.com...
> Hi,
> I wish to change the back colour for alternate rows in a report (say
> Table).
> I haven't found anything that tells me the current-rownum. The RowNum
> seems
> more like a row-count. Please help!!
> Thanks in advance,
> Regards,
> Datta
Alternate row colors by group
returnd 25 rows, the first 5 rows are one group (lets say all 'A's, the
second 5 rows are another group (lets say all 'B's), etc...
Can I add conditional formatting to alternate the backgroup color based on
groups?
I know I can alternate row colors using:
=iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White")
But I want to alternate by group. Is that possible and if so, how?
Thanks,I had a similar requirement recently but could find nothing in help or on the
net. I wrote this embedded code which works for me but I'm curious if there's
a simpler way.
Add this to the report's embedded code window:
Public GroupRowCounter As Integer = 0
Function IncrementCounter() As Integer
GroupRowCounter += 1
Return GroupRowCounter
End Function
Function GetCounter() As Integer
Return GroupRowCounter
End Function
Right click the header row you want the alternate coloring in and select
Insert Row Above. In the new, topmost header row set the Hidden property to
True and add this to one of the cells:
=Code.IncrementCounter
For the header/detail/footer portions of the group that will be visible, add
this to the BackgroundColor property to alternate the row (group) colors:
=IIF(Code.GetCounter Mod 2, "WhiteSmoke", "White")
"BillTWD" wrote:
> I have a report in which the results are grouped. For example, the report
> returnd 25 rows, the first 5 rows are one group (lets say all 'A's, the
> second 5 rows are another group (lets say all 'B's), etc...
> Can I add conditional formatting to alternate the backgroup color based on
> groups?
> I know I can alternate row colors using:
> =iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White")
> But I want to alternate by group. Is that possible and if so, how?
> Thanks,|||If you're grouping on Country, this is the code to use.
=Iif(RunningValue(Fields!Country.Value,CountDistinct, Nothing) Mod 2,
"LightGreen", "Cornsilk")
Mike Glaser
"BillTWD" wrote:
> I have a report in which the results are grouped. For example, the report
> returnd 25 rows, the first 5 rows are one group (lets say all 'A's, the
> second 5 rows are another group (lets say all 'B's), etc...
> Can I add conditional formatting to alternate the backgroup color based on
> groups?
> I know I can alternate row colors using:
> =iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White")
> But I want to alternate by group. Is that possible and if so, how?
> Thanks,
alternate line shading in a table
Is there a way to set up line shading on a report that is created from a table in SRS? The report is great but I want to shade every other line to make it easy to read and being a beginner with SRS I have not been able to find a way to do this.
Any help would be appreciated.
Thanks,
Do you mean like setting an expression in the Backgroudcolor property like: =iif(RowNumber(Nothing) Mod 2, "WhiteSmoke", "White") ?Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||
Jens,
Thanks that did it.
Tuesday, March 27, 2012
alternate colors
Hello all,
I am using sql reproting 2000. I have areport which spans a number of pages...say for every radio station, the report starts with a new page. On every page, I must have alternate row colors(white and gainsboro). It was easy to do that. The issue is, for every new page the report renders for every new radio station, the first row must be white. Say...Radio Station 1, the alternate row colors will continue...i.e white and ganisboro. But for radio Staion 2, the first row should be white again. I hope I have explained it clearly enough.
For alternate row colors, I use either an expression -
IIF(RowNumber("ds_LineUpByFeedDetail") Mod 2, "White", "#dddddd")
OR a VB Function in CODE window.
Thanks......
You can try specifying the name of the radio station group as the scope argument for the RowNumber function, instead of the dataset name, i.e. =IIF(RowNumber(<RadioStationGroup>) Mod 2, "White", "#dddddd").Alternate Background Color in Row
I am working on a report in the Reporting Services. I was wondering if we
can set alternate background color for a group of rows on the report. Let's
see the example below.
ID Name Month Field4 Field5
1 A Jan 8 9 -- Background color: red
1 A Jan 10 2 -- Background color: red
1 A May 3 3 -- Background color:
transparent
2 B Feb 2 4 -- Background color: red
3 C Apr 5 6 -- Background color:
transparent
3 C Apr 7 5 -- Background color:
transparent
4 D Mar 2 2 -- Background color: red
4 D Jun 3 1 -- Background color:
transparent
The background color will be set based on the group of ID, Name and Month
fields. Does anyone know if this is doable? If so, how to do it?
Any help would be greatly appreciated!
Thank you in advance.
Jeannetteto alternate colors in a table, place this in BackgroundColor expression:
=iif(RowNumber(Nothing) Mod 2, "AliceBlue", "White")
feel free to place whatever colors you want in there
"Jeannette" wrote:
> Hi,
> I am working on a report in the Reporting Services. I was wondering if we
> can set alternate background color for a group of rows on the report. Let's
> see the example below.
> ID Name Month Field4 Field5
> 1 A Jan 8 9 -- Background color: red
> 1 A Jan 10 2 -- Background color: red
> 1 A May 3 3 -- Background color:
> transparent
> 2 B Feb 2 4 -- Background color: red
> 3 C Apr 5 6 -- Background color:
> transparent
> 3 C Apr 7 5 -- Background color:
> transparent
> 4 D Mar 2 2 -- Background color: red
> 4 D Jun 3 1 -- Background color:
> transparent
> The background color will be set based on the group of ID, Name and Month
> fields. Does anyone know if this is doable? If so, how to do it?
> Any help would be greatly appreciated!
> Thank you in advance.
> Jeannette|||Thank you very much for your response! Carl. Although your answer is not
exactly what I am looking for, it really helps me to get to what I need for
my report. As I explained earlier in my previous message, the alternate
background color will be set based on the GROUP of ID, Name, and Color
fields. Below is what I found for my question. It really works!
In BackgroundColor expression:
=iif(RunningValue(Cstr(Fields!ID.Value) & CStr(Fields!Name.Value) &
CStr(Fields!Month.Value),CountDistinct,Nothing) Mod 2, "AliceBlue", "White")
Jeannette
"Carl Henthorn" wrote:
> to alternate colors in a table, place this in BackgroundColor expression:
> =iif(RowNumber(Nothing) Mod 2, "AliceBlue", "White")
> feel free to place whatever colors you want in there
> "Jeannette" wrote:
> > Hi,
> >
> > I am working on a report in the Reporting Services. I was wondering if we
> > can set alternate background color for a group of rows on the report. Let's
> > see the example below.
> >
> > ID Name Month Field4 Field5
> > 1 A Jan 8 9 -- Background color: red
> > 1 A Jan 10 2 -- Background color: red
> > 1 A May 3 3 -- Background color:
> > transparent
> > 2 B Feb 2 4 -- Background color: red
> > 3 C Apr 5 6 -- Background color:
> > transparent
> > 3 C Apr 7 5 -- Background color:
> > transparent
> > 4 D Mar 2 2 -- Background color: red
> > 4 D Jun 3 1 -- Background color:
> > transparent
> >
> > The background color will be set based on the group of ID, Name and Month
> > fields. Does anyone know if this is doable? If so, how to do it?
> >
> > Any help would be greatly appreciated!
> >
> > Thank you in advance.
> >
> > Jeannette
Sunday, March 25, 2012
Altering (or recreating) a Stored Procedure "header"
Friday, February 24, 2012
Already open DataReader Error
I am getting the following error when running some of my reports that use a Report Model on a recently built Windows 2003 R2 server with SQL Server 2005 SP2 intalled. The reports run fine our SQL Server 2005 RTM server.
W3wp!webserver!7!01/09/2007-12:57:58:: e
ERROR: Reporting Services
error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > System.InvalidOperationException:
There is already an open DataReader associated with this Command which must be closed first.
Any help would be appreciated.
Rick
HI Rick,
Did you manage to get a solution for this? I am experiencing the very same problem.
Already open DataReader Error
I am getting the following error when running some of my reports that use a Report Model on a recently built Windows 2003 R2 server with SQL Server 2005 SP2 intalled. The reports run fine our SQL Server 2005 RTM server.
W3wp!webserver!7!01/09/2007-12:57:58:: e
ERROR: Reporting Services
error Microsoft.ReportingServices.Diagnostics.Utilities.RSException:
An error has occurred during report processing. > Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. > System.InvalidOperationException:
There is already an open DataReader associated with this Command which must be closed first.
Any help would be appreciated.
Rick
HI Rick,
Did you manage to get a solution for this? I am experiencing the very same problem.
Allowing Users to Filter on a Report Column
I'm intending to email this report I've built in Excel format. Before this report was switched to SQL Reporting Services, it was hand built by someone who added in filtering in the spreadsheet. Is it possible to add that in with SQL Reporting Services? If so, how?
Thanks!
Interactive filter is not currently supported. However, you can use report parameter to simulate this.
1. Add a parameter to the report that passes in the filter value.
2. Define a drillthrough action on the column header where you want to let the user click to filter. Point the drillthrough report to be the same report.
Thursday, February 16, 2012
Allow users to select their own sorting
Sorting and grouping question by allowing users to select the sorting field
I have a report where I am giving the users a parameter so that they can
select which field they would like to sort on.The report is also grouping by
that field. I have a gruping section, where i have added code to group on the
field I want based on this parameter, however I also would like to change the
sorting order but I checked around and I did not find any info.
So here is my example. I am showing sales order info.The user can sort and
group by SalesPerson or Customer. Right now, I have code on my dataset to
sort by SalesPerson Code and Order No. So far the grouping works, however the
sorting does not.
So when the users selects SalesPerson from the report parameter, it will
sort by salesPerson and group by each salesperson, and when they select
Customer, it should group and sort by customer. The grouping section already
works, but I can not figure out where to change the sorting rule.
Any suggestions would help.which version of reporting services are you using?
if you are using 2005 then sorting is built in to the front end
see 'interactive sorting' at
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.SQL.v2005.en/rptsrvr9/html/7eb8dcef-d152-470d-b440-3aaa2c26fb56.htm
"armela" wrote:
> Here is my question.
> Sorting and grouping question by allowing users to select the sorting field
>
> I have a report where I am giving the users a parameter so that they can
> select which field they would like to sort on.The report is also grouping by
> that field. I have a gruping section, where i have added code to group on the
> field I want based on this parameter, however I also would like to change the
> sorting order but I checked around and I did not find any info.
> So here is my example. I am showing sales order info.The user can sort and
> group by SalesPerson or Customer. Right now, I have code on my dataset to
> sort by SalesPerson Code and Order No. So far the grouping works, however the
> sorting does not.
> So when the users selects SalesPerson from the report parameter, it will
> sort by salesPerson and group by each salesperson, and when they select
> Customer, it should group and sort by customer. The grouping section already
> works, but I can not figure out where to change the sorting rule.
>
> Any suggestions would help.
>
>
>
>|||Hi there.
I am using SQL 2005 SP1. I tried to access the website you referred to, but
that did not take me anywhere.
Can you give me website address again '
Thanks
"adolf garlic" wrote:
> which version of reporting services are you using?
> if you are using 2005 then sorting is built in to the front end
> see 'interactive sorting' at
> ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.SQL.v2005.en/rptsrvr9/html/7eb8dcef-d152-470d-b440-3aaa2c26fb56.htm
>
> "armela" wrote:
> > Here is my question.
> >
> > Sorting and grouping question by allowing users to select the sorting field
> >
> >
> >
> > I have a report where I am giving the users a parameter so that they can
> > select which field they would like to sort on.The report is also grouping by
> > that field. I have a gruping section, where i have added code to group on the
> > field I want based on this parameter, however I also would like to change the
> > sorting order but I checked around and I did not find any info.
> >
> > So here is my example. I am showing sales order info.The user can sort and
> > group by SalesPerson or Customer. Right now, I have code on my dataset to
> > sort by SalesPerson Code and Order No. So far the grouping works, however the
> > sorting does not.
> > So when the users selects SalesPerson from the report parameter, it will
> > sort by salesPerson and group by each salesperson, and when they select
> > Customer, it should group and sort by customer. The grouping section already
> > works, but I can not figure out where to change the sorting rule.
> >
> >
> >
> > Any suggestions would help.
> >
> >
> >
> >
> >
> >
> >|||Maybe you misunderstood my question
I have a paramenter on the option's screen called sorting option and the
user selects how they want to sort. Based on that paramenter,I am also
groupting data.
I have code on the Table group header for the grouping and that works fine,
however I do not know where to add code to sort the table based on the
Sorting paramenter.
Anyone have any ideas '
Thanks
"armela" wrote:
> Hi there.
> I am using SQL 2005 SP1. I tried to access the website you referred to, but
> that did not take me anywhere.
> Can you give me website address again '
> Thanks
> "adolf garlic" wrote:
> > which version of reporting services are you using?
> >
> > if you are using 2005 then sorting is built in to the front end
> > see 'interactive sorting' at
> > ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.SQL.v2005.en/rptsrvr9/html/7eb8dcef-d152-470d-b440-3aaa2c26fb56.htm
> >
> >
> >
> > "armela" wrote:
> >
> > > Here is my question.
> > >
> > > Sorting and grouping question by allowing users to select the sorting field
> > >
> > >
> > >
> > > I have a report where I am giving the users a parameter so that they can
> > > select which field they would like to sort on.The report is also grouping by
> > > that field. I have a gruping section, where i have added code to group on the
> > > field I want based on this parameter, however I also would like to change the
> > > sorting order but I checked around and I did not find any info.
> > >
> > > So here is my example. I am showing sales order info.The user can sort and
> > > group by SalesPerson or Customer. Right now, I have code on my dataset to
> > > sort by SalesPerson Code and Order No. So far the grouping works, however the
> > > sorting does not.
> > > So when the users selects SalesPerson from the report parameter, it will
> > > sort by salesPerson and group by each salesperson, and when they select
> > > Customer, it should group and sort by customer. The grouping section already
> > > works, but I can not figure out where to change the sorting rule.
> > >
> > >
> > >
> > > Any suggestions would help.
> > >
> > >
> > >
> > >
> > >
> > >
> > >|||What I have understood, correct me if I am wrong.
You have grouping in your table which you have already given code for
grouping and when it groups as per the given column name, it has to be sorted
may be asc or desc order.
If you are grouping on a table column, the same table column should be
selected in the sorting tab of the table from the drop down.
correct me if I have understood wrongly.
Amarnath
"armela" wrote:
> Maybe you misunderstood my question
> I have a paramenter on the option's screen called sorting option and the
> user selects how they want to sort. Based on that paramenter,I am also
> groupting data.
> I have code on the Table group header for the grouping and that works fine,
> however I do not know where to add code to sort the table based on the
> Sorting paramenter.
> Anyone have any ideas '
> Thanks
> "armela" wrote:
> > Hi there.
> > I am using SQL 2005 SP1. I tried to access the website you referred to, but
> > that did not take me anywhere.
> > Can you give me website address again '
> > Thanks
> >
> > "adolf garlic" wrote:
> >
> > > which version of reporting services are you using?
> > >
> > > if you are using 2005 then sorting is built in to the front end
> > > see 'interactive sorting' at
> > > ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.SQL.v2005.en/rptsrvr9/html/7eb8dcef-d152-470d-b440-3aaa2c26fb56.htm
> > >
> > >
> > >
> > > "armela" wrote:
> > >
> > > > Here is my question.
> > > >
> > > > Sorting and grouping question by allowing users to select the sorting field
> > > >
> > > >
> > > >
> > > > I have a report where I am giving the users a parameter so that they can
> > > > select which field they would like to sort on.The report is also grouping by
> > > > that field. I have a gruping section, where i have added code to group on the
> > > > field I want based on this parameter, however I also would like to change the
> > > > sorting order but I checked around and I did not find any info.
> > > >
> > > > So here is my example. I am showing sales order info.The user can sort and
> > > > group by SalesPerson or Customer. Right now, I have code on my dataset to
> > > > sort by SalesPerson Code and Order No. So far the grouping works, however the
> > > > sorting does not.
> > > > So when the users selects SalesPerson from the report parameter, it will
> > > > sort by salesPerson and group by each salesperson, and when they select
> > > > Customer, it should group and sort by customer. The grouping section already
> > > > works, but I can not figure out where to change the sorting rule.
> > > >
> > > >
> > > >
> > > > Any suggestions would help.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >|||I figured this out.
It is in group properties, sorting tab.
that is where I added code to sort by the fields I needed by using the IIF
statement and checking the paramenter values.
THanks
"Amarnath" wrote:
> What I have understood, correct me if I am wrong.
> You have grouping in your table which you have already given code for
> grouping and when it groups as per the given column name, it has to be sorted
> may be asc or desc order.
> If you are grouping on a table column, the same table column should be
> selected in the sorting tab of the table from the drop down.
> correct me if I have understood wrongly.
> Amarnath
> "armela" wrote:
> > Maybe you misunderstood my question
> > I have a paramenter on the option's screen called sorting option and the
> > user selects how they want to sort. Based on that paramenter,I am also
> > groupting data.
> > I have code on the Table group header for the grouping and that works fine,
> > however I do not know where to add code to sort the table based on the
> > Sorting paramenter.
> > Anyone have any ideas '
> >
> > Thanks
> >
> > "armela" wrote:
> >
> > > Hi there.
> > > I am using SQL 2005 SP1. I tried to access the website you referred to, but
> > > that did not take me anywhere.
> > > Can you give me website address again '
> > > Thanks
> > >
> > > "adolf garlic" wrote:
> > >
> > > > which version of reporting services are you using?
> > > >
> > > > if you are using 2005 then sorting is built in to the front end
> > > > see 'interactive sorting' at
> > > > ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.SQL.v2005.en/rptsrvr9/html/7eb8dcef-d152-470d-b440-3aaa2c26fb56.htm
> > > >
> > > >
> > > >
> > > > "armela" wrote:
> > > >
> > > > > Here is my question.
> > > > >
> > > > > Sorting and grouping question by allowing users to select the sorting field
> > > > >
> > > > >
> > > > >
> > > > > I have a report where I am giving the users a parameter so that they can
> > > > > select which field they would like to sort on.The report is also grouping by
> > > > > that field. I have a gruping section, where i have added code to group on the
> > > > > field I want based on this parameter, however I also would like to change the
> > > > > sorting order but I checked around and I did not find any info.
> > > > >
> > > > > So here is my example. I am showing sales order info.The user can sort and
> > > > > group by SalesPerson or Customer. Right now, I have code on my dataset to
> > > > > sort by SalesPerson Code and Order No. So far the grouping works, however the
> > > > > sorting does not.
> > > > > So when the users selects SalesPerson from the report parameter, it will
> > > > > sort by salesPerson and group by each salesperson, and when they select
> > > > > Customer, it should group and sort by customer. The grouping section already
> > > > > works, but I can not figure out where to change the sorting rule.
> > > > >
> > > > >
> > > > >
> > > > > Any suggestions would help.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
Allow user to choose grouping order?
We would like to set up a report such the user viewing the report could drag and drop column headers and set up grouping in whatever order they want. What would be the best way to do this? Is it even possible, or do we have to create a separate report for each combination?
For example, One report just groups by Date and Type. They might also want to group by Type then Date. Other times we want Date, Type, then color.
I used to run the reports in a third party grid which supported this, but since it was all client side, it was very slow for large datasets.
You can change the grouping through report parameters. Chris has an example of this in his blog:
http://blogs.msdn.com/chrishays/archive/2004/07/15/DynamicGrouping.aspx
'Allow null values' causes report to run automatically
I have a long running report. The report is based on a SQL Server 2005
stored procedure, with a single Integer parameter. I want to allow the
user to choose NULL for the parameter, but I don't want the report to
run without the user clicking 'View Report'. But I am finding (from
Report Parameters) when I choose 'Allow null values' there is no
default value of 'None'. I don't want to specify a default value,
because this causes the report to execute immediately.
Has anybody come across this?
cheers,
TJWhat you need, and what would be nice, is a default option of None
(not Null) which doesn't allow the report to run until the user
selects a value. Unfortunatley, the only default options you have
are: Non-queried, From query and Null.
The simplest solution is probably to set a Non-queried default value
that is invalid in your report. This will till cause your report to
run but will return an empty result set. If it's a very simple report
you could then set the visibility of your elements to not show, or
possibly show "Please select a value", if this default invalid value
is given. Otherwise you'll get an empty looking report or, worse yet,
an error; either result would probably be confusing to the user.
Matt Penner
On Jan 2, 7:28 pm, TJ <newsgroups...@.gmail.com> wrote:
> Hi
> I have a long running report. The report is based on a SQL Server 2005
> stored procedure, with a single Integer parameter. I want to allow the
> user to choose NULL for the parameter, but I don't want the report to
> run without the user clicking 'View Report'. But I am finding (from
> Report Parameters) when I choose 'Allow null values' there is no
> default value of 'None'. I don't want to specify a default value,
> because this causes the report to execute immediately.
> Has anybody come across this?
> cheers,
> TJ
Allow null value option in Report Parameters
I have very simple parameter driven report that accepts a null value.
When I enable "Allow null value" option under VisualStudio's Report Parameter, the null checkbox is checked by default when I run the report.
Is there anyway that I can uncheck the null check box by default via Visual Studio?
I know I can disable this from Report Property -> Parameter -> Has Default in Report Manager, but I would really like to do this from Visual Studio.
Thank you!You would need to provide a non-null default value for the parameter.
--
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.
"thepacket" <thepacket@.discussions.microsoft.com> wrote in message
news:06A83613-51EF-4A1A-B23F-61AF592AFC81@.microsoft.com...
> Hi,
> I have very simple parameter driven report that accepts a null value.
> When I enable "Allow null value" option under VisualStudio's Report
Parameter, the null checkbox is checked by default when I run the report.
> Is there anyway that I can uncheck the null check box by default via
Visual Studio?
> I know I can disable this from Report Property -> Parameter -> Has Default
in Report Manager, but I would really like to do this from Visual Studio.
> Thank you!
>
Allow Null Value
A given column of my Report (reporting services 2005) contains clients or
null values. I want the user to be able to chose one or more clients for the
parameter, and than show only those records of this client. I also want to
be able to chose "NULL", which will show the records with the null-values.
Also: When the user selects "(select all)" it should show not only those
with a client, but also those with a null value.
How do I have to do this? I tried with adding a Null-value row in my
parameter DataSet, but that didn't work. I also can't set the "Allow Null
Value" for my parameter ("The properties of the currently selected item are
not valid. Please correct all errors before continuing").
Does anybody know how to do this?
Thanks a lot in advance,
Pieterset your data source for the client list to:
select clientId, clientName (or whatever it is)
from clientTable
union select 0, 'All Clients'
union select -1, 'Blank Client'
order by 1
you query needs to take into account the magic values '0' and '-1'.
-T
"Pieter Coucke" <pietercoucke@.hotmail.com> wrote in message
news:uc7DB%23XfGHA.5104@.TK2MSFTNGP04.phx.gbl...
> Hi,
> A given column of my Report (reporting services 2005) contains clients or
> null values. I want the user to be able to chose one or more clients for
> the parameter, and than show only those records of this client. I also
> want to be able to chose "NULL", which will show the records with the
> null-values. Also: When the user selects "(select all)" it should show not
> only those with a client, but also those with a null value.
> How do I have to do this? I tried with adding a Null-value row in my
> parameter DataSet, but that didn't work. I also can't set the "Allow Null
> Value" for my parameter ("The properties of the currently selected item
> are not valid. Please correct all errors before continuing").
> Does anybody know how to do this?
> Thanks a lot in advance,
> Pieter
>
Allow NULL - Skips User Input
I have a report with only one parameter(Date field). It is set to allow null
value.
When I click the report it immediately starts rendering the report instead
of waiting for user input. Is it anyway to make the report to wait for user
input without removing the allow null value?
TIA,
SamuelMy understanding of your questions is that you want the report to only begin
generating after the user selects a parameter value and clicks the View
button.
If all parameters have a default value the report will execute immediately.
This is by design and cannot be modified unless you write own parameter
interface.
The workarounds are
* Do not supply a default value to one or more of parameters.
* Create a dummy report parameter and do not supply it with a default
value.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Samuel" <samuel@.photoninfotech.com> wrote in message
news:e4$C6aCgEHA.904@.TK2MSFTNGP09.phx.gbl...
> Hi All,
> I have a report with only one parameter(Date field). It is set to allow
null
> value.
> When I click the report it immediately starts rendering the report instead
> of waiting for user input. Is it anyway to make the report to wait for
user
> input without removing the allow null value?
> TIA,
> Samuel
>
Allow Multiple Parameters form Windows Application
passed into a SQL RS report. I have created a windows application that calls
sql reporting services. The problem that I am having now is passing the
multiple values the user selects from the dropdown to sql reporting services.
I am setting: returnValues.Value
When I try to set this parameters to 1;2;3, report fails. However, setting
that value to 1 works.
Is this possbile?RS 2000 does not support multiple selections. For instance,
select * from blah where somefield in (@.Param)
will not work. What you can do is use either an expression or call a stored
procedure that takes the parameter and handles appropriately).
This will work:
= "select * from blah where somefield in (" & Parameters!Paramname.value &
")"
Note that this assume you have dealt with putting in all the proper syntax
like single quotes around charater type parameters, etc and that this will
be a valid query when done.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in message
news:07E56EC7-8D86-492E-A751-199C8E4D8869@.microsoft.com...
>I have been working through a solution to allow multiple parameters to be
> passed into a SQL RS report. I have created a windows application that
> calls
> sql reporting services. The problem that I am having now is passing the
> multiple values the user selects from the dropdown to sql reporting
> services.
>
> I am setting: returnValues.Value
> When I try to set this parameters to 1;2;3, report fails. However,
> setting
> that value to 1 works.
> Is this possbile?|||I have been able to get the mulitple selection parameters to work if I call
the SQL RS report from a web page. I basically created dropdown listboxes
and have the form post to the url of the page I want to run. The multiple
selection values are sent to the report and the report works fine. However,
I am trying to call SQL RS report from a Windows Application. I have my
report created in a way that it uses a stored procedure to parse the multiple
values passed to in and joins to those values from a temp table.
"Bruce L-C [MVP]" wrote:
> RS 2000 does not support multiple selections. For instance,
> select * from blah where somefield in (@.Param)
> will not work. What you can do is use either an expression or call a stored
> procedure that takes the parameter and handles appropriately).
> This will work:
> = "select * from blah where somefield in (" & Parameters!Paramname.value &
> ")"
> Note that this assume you have dealt with putting in all the proper syntax
> like single quotes around charater type parameters, etc and that this will
> be a valid query when done.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in message
> news:07E56EC7-8D86-492E-A751-199C8E4D8869@.microsoft.com...
> >I have been working through a solution to allow multiple parameters to be
> > passed into a SQL RS report. I have created a windows application that
> > calls
> > sql reporting services. The problem that I am having now is passing the
> > multiple values the user selects from the dropdown to sql reporting
> > services.
> >
> >
> > I am setting: returnValues.Value
> >
> > When I try to set this parameters to 1;2;3, report fails. However,
> > setting
> > that value to 1 works.
> >
> > Is this possbile?
>
>|||OK, so you are doing the stored procedure method. That a good way to do it.
This whole thing work if from a web page passing in the multiple selections,
the only difference is that you are doing this from a windows app?
How are you integrating your windows app? URL integration or web services?
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in message
news:89FA2276-2654-40C1-B03C-EFE7F1B5D0F9@.microsoft.com...
>I have been able to get the mulitple selection parameters to work if I call
> the SQL RS report from a web page. I basically created dropdown listboxes
> and have the form post to the url of the page I want to run. The multiple
> selection values are sent to the report and the report works fine.
> However,
> I am trying to call SQL RS report from a Windows Application. I have my
> report created in a way that it uses a stored procedure to parse the
> multiple
> values passed to in and joins to those values from a temp table.
> "Bruce L-C [MVP]" wrote:
>> RS 2000 does not support multiple selections. For instance,
>> select * from blah where somefield in (@.Param)
>> will not work. What you can do is use either an expression or call a
>> stored
>> procedure that takes the parameter and handles appropriately).
>> This will work:
>> = "select * from blah where somefield in (" & Parameters!Paramname.value
>> &
>> ")"
>> Note that this assume you have dealt with putting in all the proper
>> syntax
>> like single quotes around charater type parameters, etc and that this
>> will
>> be a valid query when done.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in
>> message
>> news:07E56EC7-8D86-492E-A751-199C8E4D8869@.microsoft.com...
>> >I have been working through a solution to allow multiple parameters to
>> >be
>> > passed into a SQL RS report. I have created a windows application that
>> > calls
>> > sql reporting services. The problem that I am having now is passing
>> > the
>> > multiple values the user selects from the dropdown to sql reporting
>> > services.
>> >
>> >
>> > I am setting: returnValues.Value
>> >
>> > When I try to set this parameters to 1;2;3, report fails. However,
>> > setting
>> > that value to 1 works.
>> >
>> > Is this possbile?
>>|||I actually need the ability to write the report to a file or display the
report in a web browser on the screen. In both cases I have to set the
Parameter values using an array.
"Bruce L-C [MVP]" wrote:
> OK, so you are doing the stored procedure method. That a good way to do it.
> This whole thing work if from a web page passing in the multiple selections,
> the only difference is that you are doing this from a windows app?
> How are you integrating your windows app? URL integration or web services?
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in message
> news:89FA2276-2654-40C1-B03C-EFE7F1B5D0F9@.microsoft.com...
> >I have been able to get the mulitple selection parameters to work if I call
> > the SQL RS report from a web page. I basically created dropdown listboxes
> > and have the form post to the url of the page I want to run. The multiple
> > selection values are sent to the report and the report works fine.
> > However,
> > I am trying to call SQL RS report from a Windows Application. I have my
> > report created in a way that it uses a stored procedure to parse the
> > multiple
> > values passed to in and joins to those values from a temp table.
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> RS 2000 does not support multiple selections. For instance,
> >> select * from blah where somefield in (@.Param)
> >>
> >> will not work. What you can do is use either an expression or call a
> >> stored
> >> procedure that takes the parameter and handles appropriately).
> >>
> >> This will work:
> >>
> >> = "select * from blah where somefield in (" & Parameters!Paramname.value
> >> &
> >> ")"
> >>
> >> Note that this assume you have dealt with putting in all the proper
> >> syntax
> >> like single quotes around charater type parameters, etc and that this
> >> will
> >> be a valid query when done.
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >>
> >>
> >> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in
> >> message
> >> news:07E56EC7-8D86-492E-A751-199C8E4D8869@.microsoft.com...
> >> >I have been working through a solution to allow multiple parameters to
> >> >be
> >> > passed into a SQL RS report. I have created a windows application that
> >> > calls
> >> > sql reporting services. The problem that I am having now is passing
> >> > the
> >> > multiple values the user selects from the dropdown to sql reporting
> >> > services.
> >> >
> >> >
> >> > I am setting: returnValues.Value
> >> >
> >> > When I try to set this parameters to 1;2;3, report fails. However,
> >> > setting
> >> > that value to 1 works.
> >> >
> >> > Is this possbile?
> >>
> >>
> >>
>
>|||What I was trying to clarify is what does and does not work.
It sounds like calling the report from a web page using URL integration does
work. But, you are trying to use web services from your windows app (as an
alternative you can embed an IE control and use URL integration). Since you
say that a single value selected work, I wonder if some seperator character
is causing a problem. In your windows app try having a textbox that you key
in the correct value and see if that works.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in message
news:A07E6166-50E6-44D8-8ED4-3E3C279EAB1E@.microsoft.com...
>I actually need the ability to write the report to a file or display the
> report in a web browser on the screen. In both cases I have to set the
> Parameter values using an array.
> "Bruce L-C [MVP]" wrote:
>> OK, so you are doing the stored procedure method. That a good way to do
>> it.
>> This whole thing work if from a web page passing in the multiple
>> selections,
>> the only difference is that you are doing this from a windows app?
>> How are you integrating your windows app? URL integration or web
>> services?
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in
>> message
>> news:89FA2276-2654-40C1-B03C-EFE7F1B5D0F9@.microsoft.com...
>> >I have been able to get the mulitple selection parameters to work if I
>> >call
>> > the SQL RS report from a web page. I basically created dropdown
>> > listboxes
>> > and have the form post to the url of the page I want to run. The
>> > multiple
>> > selection values are sent to the report and the report works fine.
>> > However,
>> > I am trying to call SQL RS report from a Windows Application. I have
>> > my
>> > report created in a way that it uses a stored procedure to parse the
>> > multiple
>> > values passed to in and joins to those values from a temp table.
>> >
>> > "Bruce L-C [MVP]" wrote:
>> >
>> >> RS 2000 does not support multiple selections. For instance,
>> >> select * from blah where somefield in (@.Param)
>> >>
>> >> will not work. What you can do is use either an expression or call a
>> >> stored
>> >> procedure that takes the parameter and handles appropriately).
>> >>
>> >> This will work:
>> >>
>> >> = "select * from blah where somefield in (" &
>> >> Parameters!Paramname.value
>> >> &
>> >> ")"
>> >>
>> >> Note that this assume you have dealt with putting in all the proper
>> >> syntax
>> >> like single quotes around charater type parameters, etc and that this
>> >> will
>> >> be a valid query when done.
>> >>
>> >>
>> >> --
>> >> Bruce Loehle-Conger
>> >> MVP SQL Server Reporting Services
>> >>
>> >>
>> >>
>> >> "Ms Code Buster" <MsCodeBuster@.discussions.microsoft.com> wrote in
>> >> message
>> >> news:07E56EC7-8D86-492E-A751-199C8E4D8869@.microsoft.com...
>> >> >I have been working through a solution to allow multiple parameters
>> >> >to
>> >> >be
>> >> > passed into a SQL RS report. I have created a windows application
>> >> > that
>> >> > calls
>> >> > sql reporting services. The problem that I am having now is passing
>> >> > the
>> >> > multiple values the user selects from the dropdown to sql reporting
>> >> > services.
>> >> >
>> >> >
>> >> > I am setting: returnValues.Value
>> >> >
>> >> > When I try to set this parameters to 1;2;3, report fails. However,
>> >> > setting
>> >> > that value to 1 works.
>> >> >
>> >> > Is this possbile?
>> >>
>> >>
>> >>
>>
Monday, February 13, 2012
Allow Blank Values for Strings
I have a data set in Reporting Services Report (2003)
if (@.prmAudit = 0 or @.prmCellType = 0)
BEGIN
select top 5000 * from NECCCUSTAUDIT.dbo.vw_cust_audit_billing_problem b where datediff(d,@.prmStartDate,b.fld_date_time) >=0 and datediff(d,@.prmEndDate,b.fld_date_time) <=0 and b.fld_problem_type like @.prmType + '%'
END
if (@.prmAudit = 1 or @.prmType = 0)
BEGIN
select top 5000 * from NECCCUSTAUDIT.dbo.vw_cust_audit_cell_problem b
where (DATEDIFF(d, fld_date_time, @.prmStartDate) <= 0)
AND (DATEDIFF(d, fld_date_time, @.prmEndDate) >= 0) and fld_problem_type not like 'A%'
AND b.fld_problem_type like @.prmCellType + '%'
END
--
When I preview my report
Enter the Fist Date, Last Date, prmAudit, prmType
>> I do not select anything for prmCellType
There is no data seen, it is totally blank.
>> When I select FistDate, LastDate, prmAudit, prmType and prmCellType
It works all fine.
Question: I want my query to accept @.prmType as blank, so I went to Reports-->ReportParameter and allowed for Blank. This parameter is a string.
Still my Report does not do what I want?
Please could somebody help me correct my query or give a better solution.
Thank you,
Does the "allow blank" option work in preview, but not when republishing the report on the report server?
In that case, you first have to delete the report from the report server and then publish again. If you just republish over an existing report, parameter settings will be merged with the previous parameter settings (and in this case, the allow blank option will be ignored).
-- Robert
Allow anonymous access?
someone tell me what I need to do to allow everybody access to report
XYZ? Both settings required on IIS and RS.
Thanks in advance!
Stijn Verrept.1. Create a user called "Reports"
2. In Reporting Services make "Reports" a Browser user
3. in IIS use Reports as the user for anonymous access to \reports &
\reportserver
"Stijn Verrept" wrote:
> I've been trying with lots of different settings but to no avail. Can
> someone tell me what I need to do to allow everybody access to report
> XYZ? Both settings required on IIS and RS.
> Thanks in advance!
> Stijn Verrept.
>
Allignment Problem in the Body of the Report
I am using a combination of text boxes and tables. I have tried to put the text box and/or the table in rectangles, but this method does not solve my allignment problem. I also did not check The Can increase to accommodate contents.
Thanks,
AugustaI am assuming that you are rendering the report using HTML. By chance do you
have overlapping items in your report? HTML does not support overlapping
items -- they will "move" around when the report is rendered.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Augusta" <Augusta@.discussions.microsoft.com> wrote in message
news:BE01723F-FEE8-4471-B042-AFC25605B973@.microsoft.com...
> When I preview the report In design mode all contents in the body of the
report allign perpectly. After I deployed my report, some of the fields did
not allign properly.
> I am using a combination of text boxes and tables. I have tried to put
the text box and/or the table in rectangles, but this method does not solve
my allignment problem. I also did not check The Can increase to
accommodate contents.
> Thanks,
> Augusta
>|||Bruce:
You are 100% correct and Thank You so much for your help.
Thanks again,
Augusta
"Bruce Johnson [MSFT]" wrote:
> I am assuming that you are rendering the report using HTML. By chance do you
> have overlapping items in your report? HTML does not support overlapping
> items -- they will "move" around when the report is rendered.
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Augusta" <Augusta@.discussions.microsoft.com> wrote in message
> news:BE01723F-FEE8-4471-B042-AFC25605B973@.microsoft.com...
> >
> > When I preview the report In design mode all contents in the body of the
> report allign perpectly. After I deployed my report, some of the fields did
> not allign properly.
> >
> > I am using a combination of text boxes and tables. I have tried to put
> the text box and/or the table in rectangles, but this method does not solve
> my allignment problem. I also did not check The Can increase to
> accommodate contents.
> >
> > Thanks,
> > Augusta
> >
>
>