I thought I'd put something here as there are lots of posts like this on forums (a lot of which seem to be copied & pasted from other sites) but they refer to SQL Server 2000 or SQL Server 2005.

This is how to do it in SQL Server 2008 and creating a report in Business Intelligence Development Studio (BIDS) or MS Report Builder.

Scenario
I have a report that specifies some room bookings for a particular week. When I open the report, each drilldown row is collapsed (as opposed to expanded). The user can specify the date as it's a report parameter.

What we want
The user will select a date. We want the report to open with the specified day expanded and the remaining days that week to be collapsed (hidden). The first time I did this, I couldn't expand the remaining days so don't forget to tick the option "display can be toggled by this report item" like I did. ahem...


This is just a note for me as it took a while to find on the net and even then it was confusing as to why it works but it does. Not sure whether you call this an MDX Query or part of a Transact-SQL mashup. You need to go to "Fill" (of each text box in the row - unless there's a faster way) and instead of color, click on the expression button (fx) and use the following:

copyraw
=IIF(RowNumber(Nothing) Mod 2, "#ffffff", "#eeeeee")

or 

=IIF(RowNumber(Nothing) Mod 2, "WhiteSmoke", "Garamond")
  1.  =IIF(RowNumber(Nothing) Mod 2, "#ffffff", "#eeeeee") 
  2.   
  3.  or 
  4.   
  5.  =IIF(RowNumber(Nothing) Mod 2, "WhiteSmoke", "Garamond") 

This is telling the report to be white (=#ffffff) in row 1 (odd row numbers) and a very light grey (=#eeeeee) in row 2 (even row numbers). The first row being of all rows in the dataset and not for a particular drill-down item. It will alternate between the two for the rest of the report. [The second example is what I use most frequently].

Category: SQL Server Reporting Services :: Article: 320

Once again I've spent a whole morning going in the wrong direction with a convincing SQL script. This article is just a note on when using Business Intelligence Development Studio (BIDS) or Report Builder 2.0 and when previewing the report, the parameters are not accounted for (ie. the SQL query creating the dataset does not use the parameters in its query).


Problems:
  • Given a date, the date format was reverting to US format as opposed to European
  • Given a Campus as a text value, the SQL query was ignoring this completely
  • Hardcoding the scalar local variables worked


Basically I thought that the regional settings of a report generated using Report Builder 2.0 on a MS SQL Server 2008 instance were dependent on either the server or the client machine.  Realised that this was actually specified in the report. Here's a quick note on how to set Dates and Times used in parameter fields to UK format (dd/MM/yyyy).


 

Dunno about you guys but I've searched the WWW for a solution and couldn't find it.  The work around I've documented is a "solution" to my situation and environment.
 
Our setup is:
  • SQL Server 2008
  • Report Builder 2.0
  • BMC Service Desk Express 9.8
 
DataSet1:
  • Incident #
  • Group Name
  • Close Date & Time
  • Assigned to Full Name
  • Incident Type
 
The objective of this article is to explain how to hide "Series1" from appearing in your SQL Server Reporting Service (SSRS) report.  I am guessing that Series1 is the data series from an outer join where the joining index value is null.


Yes, well don't laugh, I could not find this on the WWW so I was obviously not using Google properly.  Anyway here's just a quick note on how to do if else statements in Report Builder 2.0

I'm looking at the following if statement:

copyraw
If (MyFieldName = 0) Then
     Return 1
Else
     Return MyFieldName
  1.  If (MyFieldName = 0) Then 
  2.       Return 1 
  3.  Else 
  4.       Return MyFieldName 

Can be expressed as:

copyraw
IIf(Fields!MyFieldName.Value = 0, 1, Fields!MyFieldName.Value)
  1.  IIf(Fields!MyFieldName.Value = 0, 1, Fields!MyFieldName.Value) 

Category: SQL Server Reporting Services :: Article: 261

The Issue

After modifying a report and on running it, Report Builder 2.0 returns the following error:

alt

An error occurred during local report processing.
An error has occurred during report processing.
Query execution failed for dataset 'DataSet1'.
The variable name '@GroupName' has already been declared.  Variable names must be unique within a query batch or stored procedure.

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

RSS Feed

Related Articles

Joes Revolver Map

Joes Word Cloud

case   uploaded   date   deluge   following   version   error   google   zoho   source   website   time   client   using   file   report   create   data   where   creator   need   function   page   find   added   value   license   list   would   files   joomla   table   display   windows   order   parameter   mysql   field   first   script   form   user   system   database   note   server   code   work   name   used   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.