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


Download Connectors from dev.MySQL.com

MySQL Connector/Net

Type: .NET Framework Class Library
Usage: MySql.Data.MySqlClient.MySqlConnection
Manufacturer: MySQL

Standard
copyraw
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
  1.  Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; 
Default port is 3306.

Specifying port
copyraw
Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
  1.  Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword; 

Category: SQL Server :: Article: 310

Following up on my article on correcting disappearing headers, a further issue with our web-report is that even an export to Excel (Data Only) from Crystal Reports 9, created extra columns.  This issue could not be replicated on the client machine (ie. from my workstation).  I would have to upload the report to the server, configure the web application to use the newly uploaded report, export to a Crystal Report, which in turn we export to Excel:

Note that as this is from within a web application, there are no extra options or dialogs to select.  The export had to work from this point on.  I can't take any credit for the below as it was copied from http://hosteddocs.ittoolbox.com/ST030504.pdf.  A "Crystal Decisions" documentation.

 


If you've been to the point where you're exporting a report to Excel, and only some of the column headers appear, then try this:

I googled this for ages and found different suggestions here and there but none of them produced consistent results.  One solution was to untick "Simplify page headers" on the Excel Format Options when you export the report.  Because our report is exported via a web-based system, this extra dialog doesn't appear when our users export their reports.  Not that it solved it as only some different headers appeared on the exported report when we followed that suggestion.

Consider the following report in design view, only the circled headings would appear on the exported report:


Intro

I know there are a lot of articles on the WWW detailing this process but none of them really worked for me.  I recently changed job and no longer have all my test machines at work.  Instead I only have the one workstation :eek  Still I've been asked to test some web applications (???) so I had to find a solution to suit me.  I'd done this before IE7 (so a long time since).

My office workstation setup for this is:

  • HP CMT DC7900
  • E5300 @ 2.60Ghz
  • 2Gb RAM
  • Windows XP Professional SP2 
  • Internet Explorer 7

As you can tell, not the most up-to-date but unfortunately I need to stay near to my customer base and match their setups as closely as possible.


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

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