I was having a problem printing reports using the ActiveX print mode in the Crystal Reports Viewer control. The problem is described exactly here.

When using the Crystal Reports Viewer for .NET, if the PrintMode property is set to ActiveX reports designed to print landscape will display correctly but print portrait.

There is a bug in the crystalprinthost.html located @ C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\ CrystalReportWebFormViewer3\html\crystalprinthost.html

The following code must be changed in the file:
if (window.dialogArguments.pageorientation) {
objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
objectTag += window.dialogArguments.pageorientation;
objectTag += "\">";
}

change it to:

if (window.dialogArguments.[b]paperorientation[/b]) {
objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
objectTag += window.dialogArguments.paperorientation;
objectTag += "\">";
}

NOTE: You are only changing the javascript property name pageorientation to paperorientation, the param needs to stay the same.


 
Categories: Development

March 28, 2008
@ 01:50 PM

I have inherited an application that uses some interesting design choices. I have been tasked with adding functionality. I would like to put my mantra of “improve everything you touch” in this process.

The application uses a standard nTier design pattern based on a collection of domain specific entities contained in a  Buisness.Entities.dll. This library contains two types of objects: a BusinessObjectEntity and a corresponding BusinessObjectEntityCollection. The objects do not really model any real world items, but instead contain all of the data elements needed to render a specific view.

Each object inherits from EntityBase which contains no implementation. Object collection classes inherit from EntityCollectionBase which appears to be a wrapper around List(Of T).

Here is an example of the implementation of one of the collection classes:

WARNING: VB.NET CODE AHEAD

Public Class InboxWorkItemCollection
    Inherits EDF.Entities.EntityCollectionBase(Of EntityBase)

    Public Overrides Function SetValues(
ByVal
DtReader As System.Data.IDataReader) As Boolean While (DtReader.Read()) Dim objWI As New InboxWorkItem objWI.SetValues(DtReader) Me.Add(objWI) End While Return True End Function End Class

There are ninety-one collection classes in the library that follow this pattern of reading from a Data Reader object, creating an instance of a specific class and adding it to the List collection.

Clearly there is an opportunity here to improve the design. I came up with this:

Public Class TypedEntityCollection

    Private entities As List(Of EntityBase)

    Public Sub New(ByVal reader As System.Data.IDataReader, 
ByVal
type As Type)

entities = New List(Of EntityBase) While (reader.Read()) Dim item As EntityBase item = Activator.CreateInstance(type) item.SetValues(reader) entities.Add(item) End While End Sub End Class
This new collection type still wraps List(Of T) but now expects a type parameter in its constructor. It uses this extra parameter to use create an instance of a specific class via reflection.

This appears to eliminate 90 classes and reduce the complexity of the library dramatically. How would you have approached the problem? How would you improve on my solution?

Now on to determine the level of duplication in the entity classes. Do we areally have ninety-one domain objects? I think there might be even more commonality to find yet.


 
Categories: Development

I received the following message from my local DNUG, the South Sound .NET Users Group about The Code Camp coming to our area. I plan on attending and hope to see you there.

"Are you ready for the Code Trip to come to Olympia?  Jason Mauer is coming back to Olympia with a tour bus full of geeks.  They'll be pulling up to the Thurston County Fairgrounds on Monday, April 14th.  There will be giveaways, and great information on the newest technology from great presenters.

Have you been tracking the Code Trip?  They started in Las Vegas at MIX08 on March 7th and headed north.  They've made about 13 stops since then and Olympia will be the last one before arriving at the MVP Summit in Seattle on Tuesday, April 15th.  The capacity of our venue is 288, let's see how close we can get to that total, ok? 

Jason will be sending us a list soon of the roster of geeks we'll see performing on the 14th.  We're going to set up the Expo Hall so that multiple presentations can be happening at one time, to make the most of the time we have.

Other Code Trip events have featured talks on the newest technologies to emerge from MIX08, including Silverlight 2 Beta 1, Internet Explorer 8, SQL Server Data Services, Windows Live.  Some attendees have been treated to talks on the technology powering the Code Trip, both online and on the bus.  We'll update you as soon as we know what the recipe for the Olympia stop will be.

Tell your friends, drag your co-workers along, let's give the Code Trippers a big final event before they get back to the mothership.

For more on the Code Trip, including information on current and past events and where the Bus is now, see TheCodeTrip.com.  You can see profiles of the Roadies -- people who have spent time in the bus.  There's a behind the scenes section called 'Under the Hood' where you can get information on the technologies used on the Code Trip, the use of GPS information in tracking the route and current bus location and other technical goodness being used to keep them in touch with the rest of the world.  The Toolbox provides links to the tools used along the way to keep the Trip running smoothly.

The Travel Log is a blog contributed to by various people, mostly Jason Mauer and Tim Heuer.  Video blogs, info on participants and events gets you right into the action.  It certainly gets me fired up to see them in Olympia.  Makes me more than a little envious really, getting to ride a tour bus full of state of the art equipment and full of other geeks sounds like a lot of fun.

So, you coming or what?  Put it on your calendar, invite some other folks and we'll see you there.

Monday, April 14th, 2008
6:30pm - 9:30pm
The Expo Hall at the Thurston County Fairgrounds
3054 Carpenter Rd SE
for directions"




 
Categories: Local | Development | Events

March 27, 2008
@ 09:05 AM
After listening to TWIT rave about Twitter for the better part of the last year, I finally signed up when I saw that Scott Hanselman was using it. I did what I thought was expected of me and added Leo Laporte, Scoble, Calacanis, Kevin Rose and Hanselman. I also discovered that Rollins had an account. I downloaded twhirl. I thought I had it all set up. I am officially jumping onto the new Web 2.0 bandwagon. Web 2.0 prepare to socialize me, ENGAGE!

Within about a 24 hour period, I realized I was missing something. Why did I sign up to a service that allows media personalities to spam me many times a day? Scoble and Calacanis were the first to go. Rose is hanging on by a thread. Leo doesn't really use the service, so another useless attachment. At least Scott's feed was interesting. We had a couple dialogs about mundane stuff. That was interesting and showed the potential.

So I struck out and attempted to find a peer group that I could fit into and make Twitter useful for me. I poked around in the people that Scott was following. Added a few of them. I asked in the
ALT.NET IRC channel for Twitter URLs. I now have a handful of people I respect that I am following and a few of them have chosen to follow me. I am beginning to see usefulness emerge from the tool and that is interesting.

There is still an issue with all of these social sites. The main problem being that I don't want to maintain a presence on Facebook, MySpace, LinkedIn, Twitter and the multitude of other social outlets. As I add new ones to my list of tools, others become abandoned. Images that I store in Facebook for my friends to see do not automatically show up in my MySpace page neither are my Twitter followers notified that I have added them. I am not in control of the data.

I have recently discovered some tools that attempt to tie the social sphere together.
TwitterFeed allows me to tweet when I post a blog entry. But what about Facebook & MySpace? LivingSocial offers many applications that live within the social sites that allow you to describe yourself better, but how do I get that data on to my blog? Having one central location to push social data out is an interesting problem.

Google is doing some work in this area with
OpenSocial. TwitterFeed's use of OpenID is a step in the right direction. Let's hope and advocate that these services address future problems of content ownership and keeping the data free so it can be moved around as services die off from lack of innovation or another FaceBook type crushing takeover for dominance.

 
Categories: Commentary

March 26, 2008
@ 03:58 PM
DasBlog provides systems to email daily roll up reports to you as well as an email your blog feature.

Currently I am unable to get these to work as they fail permissions checks. The errors returned are:

System.Security.SecurityException: Request for the permission of type 'System.Net.Mail.SmtpPermission'
System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission'

Any way I can get around these issues with my hosted site? Or am I pretty much SOL? This is actually the second such problem I have had in my hosted environment. The host provider has their system pretty locked down and I have no direct access to IIS. They are pretty friendly and happy to help, but I don't know if their security policy will allow me to get around this one.

UPDATE: After doing a little research on this problem, I discovered that the web.config that comes with dasBlog sets trust to medium. This prevents all of the network related features from working. I removed the trust node and allowed my hosts config to to set my level and everything is fine now.


 
Categories: Blogging

March 25, 2008
@ 10:23 AM
So I needed a sample post to see how my layout is looking before I start to insert content. When I worked tech support for Adobe way back in the '90s, every one Lorem Ipsum in their designs to simulate text. Through the power of Google, I found a nice generator for Lorem Ipsum and this is my sample post that I have now turned into an actual post.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.

Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.


 
Categories: Random