Writing custom rendering extensions

As you probably know, the custom rendering specification wasn’t documented with RS 2000. The features set was there, only the information was lacking. The SQL Server 2005 Beta 2 documentation now includes the rendering extension specification.

James Yip has written an excellent article about writing custom rendering extensions in the February issue of the MSDN magazine. As you can imagine, custom renderers are not trivial to write. For this reason, I highly recommend you check for availability of third-party rendering extensions that support the rendering format you need before you embark on this journey. For example, as I mention in one of previous posts, SoftArtisians provides flexible Excel and Word rendering extensions.

Happy rendering!

Article here, article there…RS, RS everywhere

Some of my recent writings see daylight:

Harden MS Reporting Services Using Custom Extensions (Part 1 of 2)

DevX published part 1 of my two-part article about RS Forms Authentication. It is available for free access here http://www.devx.com/dotnet/Article/26759.


“One of the most useful features of Microsoft Reporting Services is its extensibility model. Just about any aspect of Reporting Services can be custom-tailored to meet your specific requirements. Part one of this two-part series explains how to replace the default Windows-based security model of Reporting Services with forms authentication security. First, you’ll learn the ropes of implementing forms authentication security and how you can leverage it for Web-based reporting. Then you’ll enhance the form’s authentication extension by adding role-membership features to simplify the security maintenance.”

Enjoy it!

Service Pack 2 brings client-side printing

Printing reports was akward with RS 2000 to say the least. This was especially true when the reports were rendered in HTML since in this case the report is generated inside an IFRAME element. Since the frame could scroll right-clicking and engaging the standard browser printing was problematic. As a workaround, the report had to be exported in PDF format (or other non-HTML renderer) and printed as such.

You will be happy to know that SP2 puts this issue to rest by supporting client-side printing in the form of the new print control which allows printing of a report on the client side (inside the browser). This control makes printing a report a breeze. Once you install Service Pack 2 and request a report, you will see a new toolbar button added to the report toolbar (between the Refresh Report and Help buttons).


The print control is implemented as an ActiveX control. When you click on the Printer button, a request is made to download the print control if it is not installed already on the user machine. Once the download process is complete, the familiar Print Dialog is displayed.


As you can see, the print control supports also a preview mode.


Once the preview mode is initiated or the report is printed, the control instructs the Report Server to print the report using the EMF rendering extension. This is the same concept as the Bryan Keller’s article demonstrates.

The print control also supports a client-side object model (RSClientPrint object) to give developers access to the print control functionality should custom toolbars have to implemented.

Client-side printing has been one of most demanded RS features and the new print control solves this issue elegantly. For more information about SP2, please see my previous post.

Happy printing and reporting in the new 2005!

Where is my ecryption key gone?

As I stressed out in one of my previous posts and my book, it is an absolute must that you back up the RS encryption key as one of the first steps after you install RS and lock it up in a safe place. You can back up the encryption key this by using the rskeymgmt utility as follows:

rskeymgmt -e -f <filename> -p <password>

Trust me on this–sooner or later you will need that key. One situation when you will definately need it is after resetting the ASP.NET account either by explicitly invoking aspnet_regiis.exe or when installing a new version of the .NET framework. For example, recently I installed .NET Framework Beta 2 which effectively reset the ASP.NET account. This caused RS to invalidate the encryption key. As a result, when navigating to the Report Manager, I got the dreaded error:

“The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content and then restart the service.”

Panic will not help resolve this issue, but a copy of the encryption key will definetely help. Here are the steps to reset the encryption key if the ASP.NET account is reset:

  1. Recall where you saved the RS key. If you haven’t saved it or you can’t recall, try to extract the key by issuing
    rskeymgmt -e -f <filename> -p <password>

  2. Open the RSReportServer.config file and copy the installation ID GUID from the InstallationID node. The InstallationID node looks like this:

  3. Delete the references to the old RS encyption key:
    rskeymgmt -r <installation id>

  4. Restart IIS and the Report Server windows service.

  5. Reapply the encryption key:
    rskeymgmt -a -f <filename from step 1> -p <password>

This should fix the error and you should be able to navigate to the Report Manager without any issues.

If you don’t have a backup copy of the key and you cannot extract it with rskeymgmt -e, than the only option is to delete the ecrypted content by issuing rskeymgmt -d

The net effect of this is that you will need to reenter the credentials of all data sources that use standard security because the credentials are stored in encrypted format.

You better watch out…SP2 is coming to town

While we still have to wait for a couple of more months to get the official release, Santa is giving us a Beta preview of the forthcoming RS 2000 SP2.

Key new features include:

  • Reporting Services SharePoint Web Parts enable you to explore and view reports located on a report server by using Microsoft Windows SharePoint Services or SharePoint Portal Server. A set of Reporting Services SharePoint Web Parts are installed with SP2. These Web Parts are called Report Explorer and Report Viewer. Using Report Explorer, you can browse available reports on a report server. Using Report Viewer, you view reports hosted on a report server. Included with Report Explorer is a subscription function that allows you to receive reports by e-mail. Both Web Parts are optimized to run within the SharePoint environment; however, they can be run as standalone components also.
  • Yes, the wait is over! SP2 comes with a brand new Microsoft ActiveX control  to support a rich client-side printing experience and allow users can print reports directly from Internet Explorer. To support this functionality, a downloadable ActiveX control is used. The control’s .cab file is hosted on the report server and is downloaded by the client on request. When you request a report, the HTML viewer returns the report along with a toolbar for navigation. The toolbar contains a print button that displays a print dialog box when clicked. Using the dialog box, you can make standard Windows printing selections including orientation, page size and page range. When the printer settings are selected, you can select Print to print the entire report or a range of pages within the report, or Preview to preview the report in a separate preview pane.

In addition, SP2 will include numerous bug fixes as outlined in Microsoft Knowledge Base article 889640 (http://support.microsoft.com/?kbid=889640).

For instructions how to subscribe to and get SP2 Beta, please read http://support.microsoft.com/kb/889641.

Merry Christmas!

A case for self-publishing

An interesting trend has been building momentum recently which has caught my attention. More and more authors are choosing self-publishing as a viable option to commercial publishing. Interestingly, I haven’t come across a technical author who is happy with commercial publishers and has good things to say about them. Although I am not excluding the probability that there may be a few enlighten commercial publishers, the common pattern for aspiring authors is as follows.

In the worst scenario, the author doesn’t find a publisher that is willing to carry the book. Even if the author does find a publisher, things are not much better since the odds are stacked against the author. Hardly believing the incredible luck that a well-established publisher would actually debase itself to express interest in the author’s idea, the author signs a contract without much negotiation fearing that any opposition may be a deal-breaker. And it very well may be despite that the author may have valid concerns about his or her rights. A case in point — Recently, I argued with a commercial magazine publisher that there is really no legitimate reason for them to own my article copyright and the publisher dropped me like a hot potato despite the fact that the article has almost made it to the press.

As a result of the author less advantageous position, the publisher is well-positioned to take a maximum advantage of the author. Thus, with a stroke of a pen, the book copyright goes usually to the publisher whose position is further fortified with non-compete clauses of all sorts which sole purpose is to lock in the author as much as possible. At the end, the readers are the ones suffering the most since in most cases they will never see a new edition of their favorite book.

Next, the author sweats and burns midnight oil for half a year or more to get the book out. This includes authoring the manuscript, graphics, including indexing the book, organizing tech reviews, even marketing the book. The publisher responsibility is orchestrating the copy-editing, book cover and typesetting activities. These activities in my opinion don’t constitute more than 20% of the overall book effort. Yes, to the publisher’s credit, the publisher also makes an investment to get the book printed and distributed which may account for say 15K.

What does the author gets in return for his heroic effort? If all is well, the author typically gets around 10% as a royalty payment from the net (not retail mind you) price of the book which may result in 10-15K spread over the course of the book lifecycle (say 2 years) if the author is lucky and the book sells well. You may think that well-established authors are in much advantageous position but my feedback from fellow peers show otherwise. Of course, a well-established author is in much better position to negotiate a more favorable contract since the author would usually has a broader choice of publisher to choose from.

So, you don’t have to have an MBA degree to realize that there is something wrong with this model from the author’s perspective. As though it is only the author who needs the publisher…not the other way around.

What the author can do? Enters self-publishing.

It turns out that if the author is willing to undertake the last 20% of the book journey and make an investment to print and distribute the book, the author could in fact break the vicious publishing cycle and take full advantage of the fruit of his or her hard labor. And, there are more and more technical authors that are taking this road. The rewards are substantial from entrepreneurial, legal, and financial standpoints.

For example, Brian Bishof (http://www.crystalreportsbook.com/) has been very successful in self-publishing his books. In fact, his latest book (http://www.amazon.com/exec/obidos/tg/detail/-/0974953652/qid=1102890581/sr=8-5/ref=pd_csp_5/103-3694991-3165408?v=glance&s=books&n=507846) is selling better than mine according to the Amazon rating system. This is strange considering the fact that he’s writing about a competing and inferior technology-to Reporting Services :-). See what Brian has to say about self-publishing (http://www.crystalreportsbook.com/selfpublishing.asp).

Another self-publishing author is Minh T. Nguyen who wrote the Visual Studio.NET Tips and Tricks book (http://msdn.microsoft.com/vstudio/using/Books/default.aspx). He was kind enough to share his experience with me and it turns out that he also has only good things to say about self-publishing.

Based on my research, I am convinced that when done well self-publishing is a viable alternative to commercial publishing without sacrificing the book quality or market penetration. There may be still a stigma about authors who are self-publishing their books but things are changing. In fact, I believe self-publishing will change the publishing landscape as we know it.. and for better!

Get a sneak preview on RS 2005 and more…

Brian Welcker, Group Program Manager for Reporting Services, will do a
webcast on RS 2005 tomorrow at 10 am pacific time. Don’t miss this opportunity to learn about the new features in RS 2005 from the ultimate authority on this subject.

You can subscribe to the event by following this link https://msevents.microsoft.com/cui/WebCastRegistrationConfirmation.aspx?culture=en-US&RegistrationID=5154053.

There are more webcasts scheduled for tomorrow later during the day including Integration Services (aka DTS) and Analysis Services 2000.

Get a sick day tomorrow or a day off and don’t miss tomorrow’s webcast rollercoaster ride :-(