Lance's Whiteboard

Random scribbling about C#, Javascript, Web Development, Architecture, and anything else that pops into my mind.

News


Creative Commons License
Lance's Whiteboard Blog by Lance Hunt is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Based on a work at weblogs.asp.net



Sponsored Ad
Sponsored Ad

Blogs I Read

August 2005 - Posts

CodeSmith: Custom Exception Template v1.1

I recently picked up a license for CodeSmith Professional and upgraded from version 2.6 to the brand new version 3.1.  As a long-time user of CodeSmith, I love the new enhancements to both the core engine and the Studio!   The built-in Statement Completion (e.g. intellisense-style lookup) feature is worth it alone!  Great work Eric!

If you arent doing code-generation or arent familiar with CodeSmith, you should RUN, not walk, to your PC and visit CodeSmithTools.com and install the 30-day trial version!

I can't wait to try out the improved code-behind support as well as the support for nesting templates.  I had attempted to do this last year with some custom ORM generator templates, but couldnt quite get it working.  Maybe this new version will be the ticket.    The only thing that is still missing in the new version is direct support for multiple output-files from a single template.   However, with the ability to override the Render() method in CodeSmith v3.x that can even be overcome with a bit of custom plumbing for the output.

Eric mentioned at the last North Dallas .NET User Group meeting that there might be one or two obscure breaking changes in this version, so I decided to retest my custom templates.  It turns out that I had a poorly placed comment-block in my CustomException template that caused errors during compile.    No big deal - it took exactly 5 seconds to fix within the Studio.

I removed the old template, but you can download the latest version of my CustomException template here.

--------

What is this CustomException template?

In a nutshell the CustomException template generates an exception class for C# that conforms to many of the recommended best practices advocated on MSDN such as derriving from System.Exception and providing the neccessary overrides for proper serialization.  Also, for those writing COM Callable Wrappers (CCW), it defaults the HResult to the value for COR_ApplicationException, but you can override this by changing the HResult parameter value.  This can be helpful for ensuring your exceptions are marshalled back to the appropriate COM exception.  Undoubtedly this template can be improved, so feel free to post your comments here, or on the CodeSmith forums.

I'm going to PDC05!

I got a late approval today from management to go to PDC!  Woohoo!

PDC'05 - Developer Powered

Now I just have to get registered before the deadline this Friday!

 

FW: SQL Server Reporting Services - Lessons Learned In Development and Deployment

Someone recently pointed me to this excellent article on EggheadCafe.   Much of what it contains is dead-on and amounts to what has taken me a good year and a half to learn through a combination of trial & error, the anorexic Reporting Services books online, and hundreds of posts to the Microsoft public Reporting Services newsgroup.

Definitely worth reading for anyone starting with Sql Server 2000 Reporting Services as well as experts who simply want to save time (and pain) in their daily development life.   If you combine this article with the excellent book Hitchiker's Guide to Sql Server 2000 Reporting Services you should be armed with 99% of the knowledge you will need to be successful creating and deploying Reporting Services reports.

Sql Reporting SP2: Unable to install RSClientPrint ActiveX control

Here is a response I wrote for a problem posted on the Microsoft Reporting Services newsgroup:

The original problem was with Sql Reporting Services SP-2 where an end-user was unable to install the new Client Side Printing ActiveX control:

Check the user's Security settings in Internet Explorer.  Depending on how it is setup, the browser may have disabled the ability to install ActiveX controls.

Typically, you can work around this by adding the URL of your Report website to the "Trusted Sites" zone.   To do this, go to Internet Explorer settings (Tools -> Internet Options), select the "Security" tab, click on the "Trusted Sites" icon, then click the "Sites" button to add your URL to this zone.   Once this is done, click okay to close the settings and try again.  You should see the small "Trusted" icon in the status-bar of your browser the next time you visit the Report website, and it should allow installing the ActiveX control.

If its still not working, you may have to adjust the security settings manually within Internet Explorer for this zone by clicking on the "Custom Level" button on that same Security tab.  There you can enable the "Download signed ActiveX controls", and "Run ActiveX controls and plugins" options.

This is a common problem with users running Windows XP SP-2 or within a company that pushes group security policies to users' PCs to lock-out certain features.  Another frequent cause is 3rd-party anti-virus and anti-spyware utilities that often block ActiveX controls entirely.

More Posts « Previous page