# Thursday, November 11, 2010

This weekend I was trying to install the WebMatrix and it was hanging on the SQL CLR types install.  I’ve had a couple of times now when the Web Platform Installer doesn’t quite work and I don’t get any error.

I tried a couple of things like shutting down SQL Server, restarting WebPI, etc.  I found the easiest way around this is to use WebPI’s installation information window to see what the prerequisites are and run them manually.


WebPI downloads the install files to C:\Documents and Settings\[USERNAME]\Local Settings\Application Data\Microsoft\Web Platform Installer\installers.


Manually installing the prerequisites worked even though WebPI hung on the SQLCLRTypes install. 

It’s nice to know where WebPI downloads the install files in case you want to backup the files or install on another box without having to re-download them.  You could copy the installers directory to/from machines to avoid this.

The Web Platform Installer is a great little tool that has made life a lot easier but it’s not perfect.  Hopefully this little trick will help someone else out when WebPI doesn’t quite do the trick on it’s own.

Happy Coding!

Posted 11.11.2010  #    Comments [6]  | 
# Saturday, November 06, 2010

There are a lot of things that can sink an app but none more visible, yet often overlooked, than a poor user experience.sinking

User Experience Matters

Duh, of course!  Something we all know, right? But do we take care of the UI with the same passion as we do with code?  In order to ensure the user experience remains relevant and a pleasant experience requires refactoring as well.  Like code that can erode over time, the user experience can suffer the same fate.

 The Eroding UI Example

Our team has worked on an application that’s used throughout the organization to enter requests for budget.  The application has gone through several heavy revisions over the past few budget cycles and each time we have had a very tight timeline.  It’s always been a mad rush to make the modifications necessary to accommodate the changes in the process. 

Over time, the UI slowly began to mismatch how the users worked.  The UI grew into a large form and required all the fields to be filled in before a user could save any work.  The nature of how the user worked was very different.

The user process is highly iterative and collaborative within business units who are developing requests.  They often work on one section’s wording over and over until they have it just right and then move to the next section. 

Unfortunately, the UI didn’t handle this well.  Fields that required a lot of text (several paragraphs) were forced into a small text area that had to be scrolled to read.  Users would just print a report to see all the text to get around this.  With all fields being required, users entered garbage/placeholder information into fields in order to save their work.



New ideas were introduced into the process and the application grew.  A few more forms were added.  The flow was changed so that the user was required to enter this information and save it as a separate step from the main form.  The items were required but very much felt like a bolt on and not as important.


An Aside…

Who’s fault is this?  Mine.  It’s the job of the team leader to remove barriers to success and help foster and create situations that lead to success.  It took me a few tries to get us to the point where the team could work their magic properly instead of being hamstrung by constraints that could have been better managed by yours truly. 


This year we took the time to give the application some tender loving care.  The vision was to create logical sections of information.  Maximize space utilization for the sections and move away from strict validation to a routine that would allow saving work anytime while quickly showing what is left to be completed.

The team took the vision and ran with it.



The team created a new navigation section that is very pleasing on the eyes and more visible.  The team nearly eliminated the need to scroll vertically on the page. When scrolling does occur the team floated the navigation so that it will always be at the top of the screen.  The save and cancel operation work on the entire record, versus several forms that required saving separately.  Additionally, the user can save at anytime and reduced the number of absolutely required fields down to two.



The team created tabs to group similar information into sections.  The tabs have an icon representing if that section has been completed or not. 

Additional information is in each tab to help the user.  When a tab has a green check mark the tab includes a message stating it’s complete.


If the tab is incomplete, represented by the yellow warning sign, a message is shown stating what is needed and each element on the form that needs attention has the same warning icon and it’s own message.


With “softer” validation in place the user is able to work on a request in whatever order they need to and with a glance see what is incomplete.  They can also save their work in whatever state they want.  This lends itself well to the iterative drafting process of the initial budget development cycle.

Handling large text needs was simplified by giving them their very own tab.


More obtrusive (yet nice) messaging was added to the system to help ensure the user doesn’t accidently/inadvertently do something.


The real test - What are the users saying?

In the users tests we’ve conducted we received rave reviews.  We have a few weeks to go to finalize the application and go live with the entire user community.  It’s exciting!

It’s coming along great and I am extremely pleased with the team’s redesign and the large undertaking to replace the strict validation with a softer/gentler validation technique to serve the users better.  Kudos to the team!


The UI is not immune to change and requires the same level of care that code does.  The need to develop changes can erode the UI just like code.  The UI requires our attention and needs refactoring as well to stay relevant.

Happy Coding!

Posted 11.06.2010  #    Comments [0]  | 
# Thursday, October 28, 2010

ASP.NET applications run under an account with limited privileges that doesn’t have the right to connect to a network printer.  The normal answer for this is to give rights to the user running your application or impersonate a user during execution that does have the rights.

We found another way that doesn’t require changing the user or privileges of the existing account that ASP.NET apps run under.

I can hear someone asking “Why would you want to do this anyway?  Can’t the end user choose a printer?”  There might be situations where this isn’t sufficient enough.  We had to control the printer line by line in order to print on the form that is being used and a particular printer had to be used.  

We added the network printer as a printer on the server where our app was running.  When we setup the printer we chose local not networked but then on the options to use a printer port we didn’t use LPT1.  Instead we created a new port with the IP address of the device.  In our code we then call the printer by the name we gave it on our server.



The PrintDocument class in the .NET Framework allows for control of a printer.

VB Version:

Public Class SpecialReportPrintJob 
  Inherits Printing.PrintDocument 
Protected Overrides Sub OnBeginPrint(ByVal ev as Printing.PrintEventArgs) 
  Me.PrinterSettings.PrinterName = "SCLaser2" 
  'setup rest of stuff.... 
End Sub   
End Class 
'And we then call it like so 
Dim printSpecialReport as new SpecialReportPrintJob() 
C# Version:
public class SpecialReportPrintJob : Printing.PrintDocument

    protected override void OnBeginPrint(Printing.PrintEventArgs ev)

        this.PrinterSettings.PrinterName = "SCLaser2";

        //setup rest of stuff.... 
//And we then call it like so
SpecialReportPrintJob printSpecialReport = new SpecialReportPrintJob();

PrintDocument is pretty powerful.  It can control just about anything for your printer.  We passed in a text file of our data to print and our code setup the x, y coordinates of each item as it related to where on the form it needed to be.

All this without having to muck around with permissions.  Always a good thing!

Happy Coding!

Posted 10.28.2010  #    Comments [0]  |