May 17, 2005
Correction to the ReportServer zip file
Jackie Xu pointed out a problem with the original contents of the zip file the I uploaded to eliminate the ctl00oReportCell error.
The original zip contained a bad encoding in the rssrvpolicy.config file. This caused ReportingServices to throw an exception when it tried to load the file on service startup.
I've corrected the problem. If you download and unzip the files again, you should be good to go. My apologies for the screw up.
Posted by Mike Attili at 12:55 AM | Comments (0)
May 12, 2005
Guidance Automation Toolkit (GAT) Released
Tom Hollander just announced that the new extension package for VS 2005 from the Patterns & Practices group is out. For details see the Guidance Automation Toolkit home page.
I've been looking forward to this release since I first heard about it from Tom's webcast in April. The current extensibility model for Visual Studio has just needed too much work for some of the enhancements that I'd like to make. For example, a recent project had separate assemblies for each device or instrument in the system. Each time a new device was added (and we probably had over fifty device assemblies) we started out with the same core structure for inheritance, configuration, communication, exception handling,... I could have used the GAT to make short work of adding new devices and improving the code quality in the process.
The leverage that a development team can get from this group is tremendous. If I get a chance to include this with the work that I'm doing in VS2005, I'll post my observations.
Posted by Mike Attili at 12:40 AM | Comments (0)
May 10, 2005
Elimination of ADAM from TFS
Michael Shorten posted a comment wondering about the elimination of Active Directory / Application Mode (AD/AM) from Team Server.
I first caught wind of it in a comment by Brian Harry. But authoritative confirmation, for me anyway, came from Buck Hodges in a comment to a post about 'namespace administrators'.
I'm happy to see it ADAM go. The June CTP will have security native within TFS through the GSS subsystem. According to Brian, you'll be able to specify Team foundation group membership by:
- Local machine users and groups;
- AD users and groups; and
- Other TF Groups
That's the way it should have been from the beginning, but that's why there are CTPs and Betas.
Posted by Mike Attili at 12:35 PM | Comments (1)
May 09, 2005
Eliminate ctl00oReportCell error in Team System Project Portal
Visual Studio Team System includes a Project Portal site built on Windows Sharepoint Services (WSS). The Project Portal provides a convenient snapshot of the project's health and can be shared by everyone involved.
Unfortunately, the Beta 2 release contains a very annoying bug when displaying any of the reports in the Project Portal. Each report on the page pops up a message box stating "Unable to locate control: ctl00oReportCell". For the default home page, that means three message boxes everytime you load it.
I've been working on a review of Team System for one of my clients and didn't want to interrupt the presentation with these constant error dialogs. And, quite frankly, I was tired of clicking on them myself. I tried a number of tricks and came up a change to the report url didn't cause the error, but nothing was really satisfactory. So, I sat down today and fixed the problem at the source.
If you're not interested in the technical details and are not concerned about modifying the default security permissions of SQL Reporting Services (in other words, "If you trust me!"), just download this zip file and save it as: %ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer.zip then rightt click on the file and select 'Extract All...', 'Next', 'Next', 'Yes to All', and 'Finish'.
Otherwise, read on....
The error dialog displayed in the Project Portal is caused by a bug in the SQL Reporting Services April CTP page rendering when the report toolbar is not displayed. A bit of javascript is emitted before the table that the script references. IE tries to execute the script before the table containing the cell name 'ctl00oReportCell' is created, the script fails, and the error dialog is displayed.
The bug can be patched by wrapping the ASP.NET control responsible for generating the report and overriding its protected Render method.
- Create a new C# 'Class Library' project in Visual Studio and paste in the following code:
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.UI;
using Microsoft.ReportingServices.WebServer;
namespace Amaxo.ReportingServices.ReportViewerHostExtension
{
public class HostExtension : ReportViewerHost
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if ( ! base.ShowToolBar)
{
StringBuilder stringBuilder = new StringBuilder();
StringWriter stringWriter = new StringWriter(stringBuilder);
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
// Get the HTML for the report
base.Render(htmlTextWriter);
// Move the <script> element to the end
string modifiedHtml = Regex.Replace(
stringBuilder.ToString(),
"(?<badScript><script>[^<]*</script>)(?<rest>.*)",
"${rest}${badScript}",
RegexOptions.Singleline);
// Send the modified HTML to the browser
writer.Write(modifiedHtml);
}
else
base.Render(writer);
}
}
} - Add a reference to System.Web and to the ReportingServicesWebServer.dll assembly. It's located in the %ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin directory on the TFS server.
- Generate your own public/private key pair and use it to assign a strong name to the project, then build it.
- Copy the resulting dll to the same directory as the dll that you referenced in step 2.
- Now, we need to make the report server use the wrapper assembly.
Make a backup copy of %ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\Pages\ReportViewer.aspx and replace the original with the following ASP code:
<%@ Register TagPrefix="RS"
Namespace="Amaxo.ReportingServices.ReportViewerHostExtension"
Assembly="ReportViewerHostExtension" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Report Viewer</title>
</head>
<body style="margin: 0px; overflow: auto">
<form runat="server" ID="ReportViewerForm">
<RS:HostExtension runat="server" />
</form>
</body>
</html> - We need to make sure that the wrapper assembly is included as a reference when the ASP.NET page is compiled, so we need to add the following element to the web.config file at %ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\web.config
<compilation defaultLanguage="c#" debug="false">
<assemblies>
<clear />
<add assembly="ReportingServicesWebServer" />
<add assembly="ReportViewerHostExtension" />
</assemblies>
</compilation> - If you try to access the Report Server now, you'll get an error because your new assembly isn't trusted. We'll need to edit the security permissions by adding the following element to the Report Servers configuration policy file at %ProgramFiles%\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\rssrvpolicy.config. Add it immediately after the element for Report_Server_Strong_Name.
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Amaxo_Strong_Name"
Description="This code group grants Amaxo code full trust.">
<IMembershipCondition
class="StrongNameMembershipCondition"
version="1"
PublicKeyBlob="your public key blob"
/>
</CodeGroup> - Now since you don't trust me, you'll need to get the PublicKeyBlob for your new assembly. Run the following command from a Visual Studio 2005 command prompt:
secutil.exe -hex -s <your assembly> - Copy the value of the 'Public Key' in place of the "your public key blob" text in the policy file.
- Restart IIS.
You should now be able to refresh the project portal without any unsightly error dialogs.
Posted by Mike Attili at 10:16 PM | Comments (7)