SQL Server 2008 R2: Reporting Services – As You Like It

March 3, 2010

In SQL  Server 2008, Reporting Services got quite an overhaul with many features that I really like. In SQL Server 2008 R2, there are even more improvements in  Reporting Services that I am anxious to put into production. There is one new feature in particular that I,  like many report developers, am eagerly anticipating – the RenderFormat global variable. You can use it in an conditional expression to change  a report property value based on the current rendering format. In other words, you can build one report and change the behavior by rendering format – as you like it!

Before I explain how to use it, let me explain a common problem that it solves for me. Many of my Reporting Services projects have its most commonly used rendering format. One project might be primarily intended for online viewing, so the design work focuses on making the report attractive, interactive, and sized for the user’s standard screen. However, when the user wants to export the report to Excel, features that render nicely online do not render so nicely in Excel. Sometimes headers cause merged cells to appear in the Excel format, which then affects your ability to sort or filter by columns. To work around this issue, I design a second report to get a layout that works better in Excel. That is, I’ll create a minimal version of headers that doesn’t cause merged cells and create a simple table layout that renders nicely in Excel, but looks rather plain in HTML format. I then add a link to the HTML version to make it easy to get to the Excel version.

From a technical perspective, I can use this technique in Reporting Services to produce one report that displays online in HTML and another one that winds up as a table in Excel. From a practical perspective, though, I have two reports to maintain. And it’s potentially confusing to users to have to remember whether to use the Export to Excel command or click a link to get to the Excel version. The situation compounds further when I need to anticipate the export of the report to yet another format, such as PDF. Yikes!

That’s where the RenderFormat global variable in SQL Server 2008 R2 Reporting Services comes to the rescue. On report headers, I can set the Hidden property using a conditional expression that checks the value of RenderFormat. Maybe I have two different styles of headers on the same report, HeaderA and HeaderB. For online viewing, I can set the Hidden property to False on HeaderA to display it when the report opens in any format (other than Excel) and then if the user exports to Excel, I can switch the Hidden property to True. Likewise, HeaderB’s Hidden property would be set to True when the report is in any format (other than Excel) and False when the report is in Excel format.

Here is the expression for HeaderA’s Hidden property:

=iif(RenderFormat.Name="EXCEL", True, False)

And here is the expression for Header B:

=iif(RenderFormat.Name="EXCEL", False, True)

Note that EXCEL must be all caps here to work properly. Actually, it’s not so much that the name of the render format needs to be in caps, but it needs to match the render format’s name as it appears in the rsReportServer.config file (in Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer). Look for the <Render> element. Here’s an example of the default render formats available in SQL Server 2008 R2 Reporting Services:

XML
CSV
ATOM
PDF
RGDI
HTML4.0
MHTML
EXCEL
RPL
IMAGE
WORD
There are many other features I’ll be discussing in future posts, but I picked this one as my favorite new feature because it’s the very one I need on a project right now!
0

Installing Reporting Services 2008 R2 in SharePoint Integrated Mode

February 20, 2010

I recently performed an installation of Reporting Services 2008 R2 in SharePoint Integrated mode on two servers. The SSRS integrated mode R2 version is supposed to have much improved performance over the previous version. I’m still in progress of benchmarking tests, so can’t comment yet, but there were some installation steps that I had to perform above and beyond the documented steps that I thought I’d post here as a reminder to myself – and anyone else that has a need. These steps were tested against the November CTP of R2 and might change when the Release Candidate comes out soon. I’ll post more complete instructions at that time and point out what changes, if anything.

You can find the official installation instructions on the page for downloading the SharePoint Add-in here: SQL Server® 2008 R2 November CTP Reporting Services Add-in for Microsoft SharePoint® Technologies 2010. I’ll use those instructions here as a starting point using a blue font, and interject with the additional steps that I performed in black font.
Let’s get started. In my environment, I have one SharePoint server which I’ll call SP01, and one SQL/SSRS server which I’ll call RS01. Both are running Windows Server 2008 R2 64-bit. Note – I did NOT install the Windows hotfix required to run PowerPivot for SharePoint (see if you need to know more about the hotfix) since this server environment was set up just for testing SSRS.

You can install and configure the servers in any order, but integrated operations will not be available until the configuration steps are complete for both servers. For detailed information on the installation steps, see the Readme for the existing Reporting Services Add-in.

    Step 1: Install a SharePoint technology instance.
On SP01, I installed SharePoint Beta 2 using the Server Farm/Complete option during installation since I wanted to host the SharePoint databases on server RS01. I ran the configuration wizard and selected the option “Create a new server farm”. I then provided info to use RS01 as the database server and typed a database name and credentials, then a farm admin passphrase. I set the Central Admin authentication to NTLM. In Central Admin, I used the option to set up everything myself and only set up the service account. I did not set up any services, since I was only interested in the SSRS integration. I did create an initial site collection – I’ll call it B – using a blank team site.

On RS01, I used the same installation media and used the Server Farm/Complete option.  I ran the configuration wizard and selected the option “Connect to an existing server farm”.  Then specify configuration database settings – point to RS01 and the database created when configuring SharePoint on SP01, provide the passphrase, and finish up by walking through the wizard using defaults. RS01 is joined to the SP01 farm.
    Step 2: Install SQL Server 2008 R2 November CTP Reporting Services and specify that the report server use SharePoint Integrated mode.
I installed the database engine and SSRS with the SharePoint Integrated mode option.
    Step 3: Configure Reporting Services.
Here I made sure I had a valid service account, and set up the database to run on RS01. I validated that all was well by going to the report server URL, like this: rs01/reportserver. Even though you haven’t finished the configuration, you should be able to confirm that the server is running. (I can’t recall the exact message here- I’ll post it later when I run through the RC installation.)
    Step 4: Download the Reporting Services Add-in by clicking the rsSharePoint.msi link later on this page. To start the installation immediately, click Run. To install at a later time, click Save.
    Step 5: Install the Reporting Services Add-in and configure the report server on the SharePoint technology instance.

I ran into trouble at this step when the add-in refused to install and rolled back without explanation.
Here’s what I did to resolve – it just worked so no clue (nothing in event log) as to why it failed with normal installation:
  1. Open a command prompt.
  2. Change to the directory where the .msi file resides.
  3. Type msiexec /i SharePointRS.msi SKIPCA=1
  4. The installer opens. Just follow the normal flow, and it should finish successfully.
  5. Type cd %temp%
  6. Type rscustomaction /i

IMPORTANT - even if you have Admin rights on the server, you MUST open the command text prompt using Run As Administrator.

You know it worked when you can open General Application Settings page in Central Admin and see the Reporting Services section.

Step 6: Set permissions and add Reporting Services content types.

In Central Admin, go to General Application Settings page and click the Reporting Services Integration link.
Type in the Report Server Web Service URL (as it appears in the Report Server Configuration Manager). Because I”m not using Kerberos in this environment, I set the authentication mode as Trusted Account. I put in the credentials for the admin on RS01, and clicked OK.

Here I ran into another problem. In the log file, I found the following message:

The request failed with HTTP status 401: Unauthorized

I knew this was some sort of authentication issue but it wasn’t immediately obvious where or how. From SP01, I could not connect to the server (http://RS01/reportserver) – I got the NT challenge prompt 3 times. Here’s what I did to fix:

I removed RSWindowsNegotiate from the RsReportServer.config file and then did stop/start on the SSRS service using the Reporting Services Configuration Manager. That left RSWindowsNTLM in the config file, and forced NTLM authentication for the report server and all was fine after that in terms of authentication.

Although I specified “activate feature in all existing site collections”, it didn’t happen. I had to manually activate the feature in my blank site but that worked fine. Then I successfully deployed reports and was able to view the reports. I’ll be analyzing performance in the coming weeks and will post my conclusions.

1

Happy New Year!

January 6, 2010

It’s amazing how natural it feels to write out 2010 on checks this first week of the new year. Usually it takes me at least a month. Maybe that’s a sign of good things to come this year. Probably like many of you, I look forward to the clean slate that the start of a new year brings, although intellectually I know it’s an arbitrary marker in time. Nonetheless, I am excited by the new year and the plans that are underway. One of my resolutions is to blog more. With the upcoming release of SQL Server 2008 R2, there will be plenty to blog about. However, I’m currently heads down on writing a course and co-authoring two books that deal with the BI features in R2, so I won’t start blogging in earnest until I can get past my current set of deliverables. Which will be soon. Very soon. Consider this a teaser!

Meanwhile, my daughter Erika has decided to launch her blog at http://erikasblog.datainspirations.com/. I do believe we are the first mother-daughter BI consulting team, but I could be wrong. At any rate, I think we make an awesome team and no doubt am biased about that. Erika started working with me just 3 days after she graduated from MIT in June 2008, and she immediately started helping me with work on one of the hardest BI projects I have ever encountered. Nothing like trial by fire! She has come through that project (and a few others since) with flying colors and can write some incredible MDX. It’s been interesting to observe her learning process. Typically, I have 1-3 days to teach someone MDX and I don’t get to track their growth after the class is done. Erika didn’t have any T-SQL baggage to unlearn as she tackled MDX, but I suppose being a theoretical math major doesn’t hurt. We hope to leverage her experience into some new ways of explaining MDX this year. 
Comments Off

Introduction to Business Intelligence Articles at TechNet

November 10, 2009
Tags: , ,

TechNet is publishing a series of four articles introducing readers to business intelligence. I have written two of these articles while a friend of mine, Derek Comingore of BI Voyage, has written one of them. The fourth article is not yet written, but I’ll post a link here when it becomes available. A lot of people refrain from using the BI components in Microsoft SQL Server because they don’t want to undertake building a data warehouse. There are lots of good reasons to build a data warehouse, but if you are the only consumer of data, you obviously don’t need a data warehouse, but I think you ought to be able to use these tools anyway to help you do your job better. If only you knew how. This article series should help get you started.

Business Intelligence: Planning Your First Microsoft BI Solution
August 2009
Even BI novices can learn what goes into creating a BI solution, from planning and designing a data mart to preparing data. An Adventure Works example illustrates the first steps a company can take to ensure that its BI solution supports the strategic decisions it needs to make.

Business Intelligence: Building a Data Foundation for a BI Solution
August 2009 – Derek Comingore
See how you can design and build a data mart that uses SQL Server 2008 Integration Services to perform the extract, transform and load (ETL) processes for the Adventure Works BI solution introduced in “Planning Your First Microsoft BI Solution.”

Business Intelligence:Building Your First Cube
November 2009
There’s lots more to your data than you can see at first glance. Learn what a cube can do for you — and how to build one. We show you how.

Comments Off

Best Practices Conference

August 19, 2009
Tags: ,

Life as an independent consultant is interesting and challenging, but it gets a little lonely in the sense that you don’t spend a lot of time with your industry peers. That’s why I enjoy getting out to conferences each year. I always run into people I know and admire and get to pick their brains on some nagging issue I’m battling at the time and I always get to meet new people who are doing interesting things. And of course I get to share what I know, too. This year I’m going to the Best Practices Conference for the first time, but I recognize most of the speakers’ names so there will be many familiar faces and I feel privileged to be included with them.

I’m presenting the following two topics –

BI316, Optimizing Your MDX Queries

Retrieving data from an Analysis Services cube is supposed to be fast, right? Then why are your queries running so slowly? Many factors can contribute to poor query performance. If you have applied best practices design principles to cube and dimension design, the next step is to evaluate the design of your MDX queries. In this session, you first learn how to know whether your query or the cube needs to be optimized. Then you learn the principles of optimal MDX query design in Analysis Services 2005 and Analysis Services 2008, and how to modify your queries to deliver data faster.

BI337, Designing Analysis Services Cubes for Performance

Building a cube is simple. After all, you have a lot of wizards at your disposal to do the development work. But building a cube that delivers data quickly requires you to make additional changes to the database design. Come to this session to learn what steps you need to take in the development process to ensure the cube is designed for optimal performance, whether you’re using Analysis Services 2005 or Analysis Services 2008. You learn not only how to properly design dimensions, aggregates, and partitions, but why these design principles improve performance.

If you’re planning to be there, be sure to stop by and say hello!

Comments Off