Sharing Lost Reports with Web Users

Scenario

You need to configure a SharePoint site integrated with Reporting Services for Internet access. In our case, the end users would authenticate with Windows security by using local Windows account created on the web server.

Issues

Report URLs reference the machine NetBIOS name and fail to execute with “The path of the item ‘<path’ is not valid. The full path must be less than 260 characters long; other restrictions apply”. Same happens when Report Builder tries to load models.

Solution

This one took a few hours to solve:

  1. Since Reporting Services 2008 only supports access from SharePoint URLs in the default zone, change the public URL of the default zone (SharePoint 3.0 Central Administration -> Operations -> Alternate Access Mappings) to the web server Internet URL, such as http://www.adventure-works.com/.

    This will take care of the report URLs which now should include the server Internet address. However, requesting reports would result in rsItemNotFound errors although the report URLs look perfectly normal.

  2. Open the report project in BIDS. In the project properties, change the TargetDataSources and TargetReportFolder settings to include the server Internet URL instead of NetBIOS names, such as http://www.adventure-works.com/Report Library/Shared Documents/Data Sources for the TargetDataSource setting.

    051008_0055_SharingLost1

  3. Redeploy the report definition.

At this point, standards reports deployed to SharePoint should work. If you use local server accounts for your users, however, previewing reports in Report Builder may fail with mysterious errors about invalid semantic queries. You can solve this issue by making sure that the user logon and server accounts are identical, that is, have the same name and password.

Tricksy Parameter Prompts

Q: How to make the darn parameter drop-down list wider in HTMLViewer? HTMLViewer is the Report Manager control that displays the report when you view the report.

A: HTMLViewer supports limited customization via a CSS stylesheet.

  1. Copy HTMLViewer.css to MyHTMLViewer.css in the same folder (Reporting Services\ReportServer\Styles). Note that the actual folder path varies between SQL Server versions.
  2. Add the following CSS style to MyHTMLViewer.css

SELECT {

font-size: 8pt;

font-family: Verdana;

width:200px

}

As a result, all SELECT elements on the page (all dropdowns, such as parameter prompts, zoom, export) will pick up these settings.

  1. Configure the server to use the custom stylesheet by one of these options:
    1. If you want to apply the custom styles to all reports, add a new HTMLViewerStyleSheet element to the rsreportserver.config file, such as:

<Configuration>

<HTMLViewerStyleSheet>MyStyleSheet</HTMLViewerStyleSheet>

</Configuration>

Note that due to an unfortunate bug, the HTMLViewerStyleSheet setting doesn’t work with February CTP of SQL Server 2008 but it will be fixed in the final release.

  1. Use the rs:Stylesheet device setting to apply the custom style to given report only, such as:

http://localhost/ReportServer?/AdventureWorks Sample Reports/Product Line Sales&rs:Command=Render&rc:Stylesheet=MyStylesheet

Applied Microsoft Analysis Services 2005 Goes E-Book

I happy to announce my book “Applied Microsoft Analysis Services 2005” is now available as an Adobe PDF e-book. The first retailer that Google Alerts reported to sell it is Diesel Ebooks. It should soon pop up on all popular ebook retailer sites, such as ebooks.com. The suggested retail price for the ebook version is set to $39.95, which is ten bucks cheaper than the suggested retail price of the paper copy. The ebook is DRM-protected but fully functional with unlimited printing and copying capabilities. The DRM protection is handled by the retailer. Since the distributor is not set up to handle different pricing models, such as buy the paper copy and get the ebook free, there is no discount pricing model for the e-book version at this time.

Also, the same book is now available on Amazon Kindle. Since I don’t have an Amazon Kindle, I don’t know what the Kindle version looks like. Unfortunately, Amazon doesn’t support PDF. They use proprietary software that converts the book to the Kindle native format (AZW). If you buy the Kindle copy, please drop me a note to share your feedback.

The Rational Guide To Planning with Microsoft Office PerformancePoint Server 2007

I have to admit that my preoccupation with Reporting Services and Analysis Services don’t leave me much bandwidth nowadays to tackle other Microsoft BI (far less third-party) offerings. One of the products I know I need to catch up is the planning component of PerformanceServer, formerly known as Biz#. Fortunately, Nick and Adrian followed up on their The Rational Guide To Planning with Microsoft Office PerformancePoint Server 2007, which I wrote about, with a new book
The Rational Guide To Planning with Microsoft Office PerformancePoint Server 2007. Initially, they were planning a single PerformancePoint book but they decided to split it because of book size limitations that the publisher has.

The planning piece of PerformancePoint requires more than solid knowledge of Analysis Services because of its strong financial focus. You need to know quite a bit about budgeting, planning, chart of accounts, and other financial concepts. Fortunately, The Rational Guide To Planning with Microsoft Office PerformancePoint Server 2007 fills in the gap and bridges the implementation and business audiences by providing an essential coverage of the product accompanied with practical examples, all in a portable light-size format.

031508_2246_TheRational1

SQL Server 2008 February CTP Is Out

February CTP is out. It brings the much anticipated integration with Visual Studio 2008 and the new BIDS Report Designer.

Download the February CTP here:
http://www.microsoft.com/sql/2008/prodinfo/download.mspx

Updated Books Online for February CTP are available here:
http://www.microsoft.com/downloads/details.aspx?familyid=19DB0B42-A5B2-456F-9C5C-F295CDD58D7A&displaylang=en


What’s new in Reporting Services February CTP (compared to the previous November 2007 CTP):

  • Support for Microsoft Word Rendering
    This allows users to render reports as Word documents that are compatible with Microsoft Word 2000 and greater.
  • Data Visualization Enhancements
    Data Visualization Enhancements provides significantly improved support for Chart and adds support for Gauge controls directly within reports.
  • SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies
    The SQL Server 2008 Reporting Services Add-in for SharePoint Technologies allows you to take advantage of SQL Server 2008 report rendering, processing and management capabilities in SharePoint Integrated mode.  This version includes Data-driven subscriptions.
  • Report Design Enhancements in Business Intelligence Development Studio (BIDS)
    BIDS overall has been migrated from a Visual Studio 2005 to Visual Studio 2008 platform.  In addition, the report design tools found in BIDS were significantly updated for Reporting Services.  Updates include:
    – the more powerful Tablix based Tables, Lists, Matrices
    – the Report Data window for easier interaction with data fields
    – the integration of data visualization enhancements (Chart, Gauge)
    – new dialogs throughout the design experience
  • Throughput Enhancements
    Further improvements in report rendering throughput, the number of reports rendered in a given amount of time for several types of workloads.

Last Non Empty Affairs

Enterprise Edition of Analysis Services 2005 and 2008 supports semi-additive functions, such as LastNonEmpty, LastChild, and so on, to facilitate working with semi-additive measures, such as account balances and inventory snapshots. For example, the screenshot below shows LastNonEmtpy in action. To demonstrate this, I added a Last Sales measure to the Internet Sales measure group in the Adventure Works cube and set its AggregationFunction property to LastNonEmpty. Of course, this doesn’t make much sense because sales amounts are fully additive but it’s OK for demo purposes.

020608_2350_LastNonEmpt1

As expected, the quarter and year totals show the last non empty sales. The customer totals are correct too because semi-additive measures sum across any dimension except Time. But what about the grand total of $14.98? Shouldn’t we get the sum of the quarter (or year) subtotals?

To answer this question, we need to understand how LastNonEmpty operates. LastNonEmtpy works across time and not across other dimensions. Because the last customer recorded sales are in June 2008, LastNonEmpty gives you Q2 total of $14.98 which becomes the YTD total as well. So, does it make sense to sum the totals vertically? The philosophical answer is “it depends”. If this was inventory balances, the question is why we have missing balances in the last day. In other words, to get the vertical sum right we need to record balances for each product for each period. One may say that in this case LastNonEmpty is correct because it makes no assumptions about what happened to the “missing” values for products, customers, etc. It could be that we didn’t record them or it could be that there we discontinued that their ending balance is indeed not applicable.

But, there could be cases when we need LastNonEmpty to sum vertically instead of getting the last values. For example, the cube may have test scores and you may need to get the last score, such as to calculate the average student or school score. To address this requirement, our first impulse could be to use a scope assignment that overwrites the (Root(Customer), Root(Date)) tuple to server SUM aggregate function (the one you specify in the AggregateFunction property). But, as it stands, SSAS doesn’t support plugging in server aggregate functions in scope assignments.

So, we will try the reverse approach:

  1. Add a new fully-additive measure Sales with SUM aggregate function.
  2. Overwrite the Sum with LastNonEmpty at the customer level.
  3. Hide Last Sales and use Sales instead.

Scope

(

[Date].[Date].[All],

[Customer].[Customer].[Customer].Members, /*or Leaves(Customer)*/

{

[Measures].[Sales]

}

);

this = [Measures].[Last Sales]; /*assign Last Sales to Sales to make it semi-additive at customer level*/

End Scope;

Note that [Customer].[Customer].[Customer]. Members exclude the Customer All member. Since the server uses the All member to aggregate up, aggregating at a higher level, such by product will work fine because All member will contain the SUM of the last sales.

It will be great if a future SSAS release supports:

  1. Using server aggregate functions in scope assignments
  2. Give the modeler an option to control the behavior of the semi-additive measures.

SQL Server 2008 Expected Q3 2008

Francois Ajenstat, Director of Product Management for Microsoft SQL Server, tells us that SQL Server 2008 will be released in Q3 2008 while Release Candidate (RC) is expected in Q2. The February 27th marketing launch date remains unchanged.

Where Are Report Server Content Types Gone?

SharePoint always has a trick up its sleeve to surprise the innocent. I have to admit that I continue to be baffled by this technology. Not that I know too much about it, of course. But this thing is like the Pacific Ocean – web applications, site collections, sites, oh my. The further you go, the deeper it gets. Things that still escape my mind include how to get the default Office Server web site (with the Report Center, etc.) after upgrading from WSS 3.0, why I cannot implement custom SharePoint filter provider web parts in WSS given that the interfaces are in WSS, and the mother of all questions, why WSS supports Windows Server OS only.

One thing, however, I managed to figure out (of course, after hours of experimenting, installing, and head-scratching since documentation is, shall we say, wanting) is how to get the Report Server content types to show in Microsoft Office SharePoint Server 2007. If you installing a new MOSS installation, after installing the Reporting Services Add-in, the Report Server content types should show up in the site settings. However, if you are upgrading from WSS, they may not show up. The issue could be that the Report Server Integration Feature is not activated. To check:

  1. Open the site, expand the Site Actions and go to Site Settings, Modify All Site Settings.
  2. Under Site Collection Administration, choose Site Collection Features. If this is not a top-level site, you need to select the link for the Top Level Site Collection Features.
  3. Check the Report Server Integration Feature. If it is deactivated, click Activate. Isn’t this tricksy?

That should do it. You should be able to add the Report Server content types to the site.

011308_0254_WhereAreRep1

Trying to Communicate

Visual Studio 2008 embraces the exciting new world of Windows Communication Foundation (WCF) for communicating with services. However, pitfalls await the unwary. I’ve recently tackled invoking the Reporting Services Web service with WCF and I want to share my findings.

  1. The Visual Studio Add Web Reference menu has been renamed to Add Service Reference to denote that WCF can communicate with much more than Web services, including probably my Zune device. Although the dialog has somewhat changed, you will be find your way to generate the proxy.
  2. What’s more surprising is that the auto-generated proxy methods now have somewhat different signatures.

For example, the SQL Server Books Online has the following signature of the Reporting Services GetExecution Options API.

public ExecutionSettingEnum GetExecutionOptions (string Report,out ScheduleDefinitionOrReference Item);

Yet, WCF generates the following signature:

public ServerInfoHeader GetExecutionOptions(string Report, out ExecutionSettingEnum executionOption, out ScheduleDefinitionOrReference Item);

So, the returned value becomes an out parameter while ServerInfoHeader becomes a returned value. I am not sure how WCF figures this out. Does it mean that now the documentation should show both the 2.0 and WCF signatures?

  1. The second surprise wave hit me when I was trying to figure out a way to pass my credentials to the Web service. This, of course, will probably be one of the first things you need to do to invoke an Intranet service.

In the good ol’ 2.0 days, impersonating the user takes a single line of code.

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

How do we this in the shiny new WCF world? Strangely, the Visual Studio help says little about this. I came across some bizarre examples of declaring HTTP transports that made my head spin. In a sheer stroke of luck, I managed to figure out the right changes in the application config file (yes, now we have declarative settings).

<security mode=”TransportCredentialOnly“>

<transport clientCredentialType=”Ntlm” proxyCredentialType=”None” realm=”” />

<message clientCredentialType=”UserName” algorithmSuite=”Default” />

</security>

Wait! We need to tell WCF also that is OK to impersonate the user.

ReportingService2005SoapClient rs = new ReportingService2005SoapClient();

rs.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

At this point, I felt like upgrading my house only to find that I have to enter through the chimney. Upgrading to a new technology shouldn’t complicate things unnecessarily. I promptly switched back to the 2.0 style of programming. Luckily, they kept the old Add Web Reference button from the advanced settings of the Add Service Reference dialog.

I guess they were right. You can’t teach an old dog new tricks…

Happy holidays!

Analysis Services Many-to-Many Dimensions: Query Performance Optimization Techniques Whitepaper Available

The Microsoft CAT team has released a new whitepaper Analysis Services Many-to-Many Dimensions: Query Performance Optimization Techniques.

“Many-to-many dimension relationships in SQL Server 2005 Analysis Services (SSAS) enable you to easily model complex source schemas and provide great analytical capabilities. This capability frequently comes with a substantial cost in query performance due to the runtime join required by Analysis Services to resolve many-to-many queries. This best practices white paper discusses three many-to-many query performance optimization techniques, including how to implement them, and the performance testing results for each technique. It demonstrates that optimizing many-to-many relationships by compressing the common relationships between the many-to-many dimension and the data measure group, and then defining aggregations on both the data measure group and the intermediate measure group yields the best query performance. The results show dramatic improvement in the performance of many-to-many queries as the reduction in size of the intermediate measure group increases. Test results indicate that the greater the amount of compression, the greater the performance benefits—and that these benefits persist as additional fact data is added to the main fact table (and into the data measure group).”