Monday, May 14, 2007

Reporting Services Table Column Headers in Excel

Recently I've been working with SQL Reporting
Services. I have a generally high opinion of
the product, but I have discovered a fairly large
problem. It does not support repeating column
headers when exported to Excel.

What I have found is that this isn't a bug
in fact it was a design decision to put headers
in the repeating rows in order to support
images. With the repeating rows in use;
there is no other way to repeat information
on each page.

The header can be moved to the excel header
by setting the UseSimpleHeader tag in the
device directive, but even then the table
header row won't repeat. My personal
opinion is that this shouldn't be a big deal
because if the report is exported to PDF
the column header repeat just fine, I have
to imagine that plenty of offices won't view
that as an expectable solution.

By the way, I'm not a Reporting Services
expert, if there is something I've missed
please tell me.

Saturday, April 28, 2007

Richmond Code Camp 3

So I decided to skip a session at the Richmond Code Camp, and I thought now would be a good time to write a blog post; so here goes. This is the third code camp here in Richmond and it’s been a great success, other then the fact that it rained for the third time as well. It’s the biggest one yet, or so they tell me, and I love that. The quality of speakers is excellent and just gets better every time, it’s a shame nobody from my office comes with me. My only real gripe is, as always, the name; couldn’t we call it the “Richmond Day of .Net” why must I be ridiculed for trying to better myself as a professional, dang! Oh well, time to head to the next session catchya later.

T

http://www.richmondcodecamp.org/

Thursday, April 12, 2007

Current Tech Podcast lineup

I've become a bit of a podcast enthusiast lately. I'd posted before about
listening to tech podcasts but I thought it was time to revisit the topic.
Now that I actually have an Mp3 player I find myself listening to podcast in
the car as well as at work. They are a great way to keep up with current
trends without having to spend hours a day reading, though I do that too.
So here's a list of what I'm listening too. This list usually amounts to
about five hours of listen time a week which cover my commuting time nicely.


.NET Rocks <http://www.dotnetrocks.com/>
ARCast <http://channel9.msdn.com/>
Hanselminutes <http://www.hanselminutes.com/>
this WEEK in TECH (TWiT) <http://www.twit.tv/>
Windows Weekly <http://www.twit.tv/>

Friday, March 30, 2007

Using Forms Authentication with Callbacks

We use callbacks all over the place in our asp.net applications. Because of
various security and technical concerns we also use forms authentication by
default. Well this creates a problem when the forms authentication ticket
expires. In the traditional model using postbacks when the authentication
ticket expires you are redirected to the login page however when a callback
occurs there is no action by default. After discovering this I began
googling for information and found this blog post
http://blogs.msdn.com/irenak/archive/2007/03/12/sysk-304-how-to-detect-and-h
andle-form-based-authentication-timeout-during-asp-net-script-callback.aspx.
Admittedly it is a little hacky but I think it works well for our purpose.
Read the article, but the jist is this:

Micorsofts callback javascript handler expects a response that either begins
with an 's' for success or 'e' for error. The authentication failure does
not return either of these

To get around you add a handler for the Application_AuthenticateRequest
event in the global.asax. In the handler, write a message to the response
the begins with an 'e' then you can redirect to the login page from within
the the Callback error javascript.

Wednesday, March 14, 2007

Use Once Dialog

In my post on Handling alerts in WATIN
<http://tmichealson.blogspot.com/2007/01/handling-alerts-in-watin.html> I
referenced a class called UseDialogOnce and did not show the code for it.
This is an adaptation of the one that is in the WATIN Unit tests file
IeAndMainDocument.cs

using System;
using WatiN.Core;
using WatiN.Core.DialogHandlers;

namespace Framework.UnitTesting
{

public class UseDialogOnce : IDisposable
{
private DialogWatcher dialogWatcher;
private IDialogHandler dialogHandler;

public UseDialogOnce(DialogWatcher dialogWatcher,IDialogHandler
dialogHandler)
{
this.dialogWatcher = dialogWatcher;
this.dialogHandler = dialogHandler;

if (dialogWatcher != null)
{
dialogWatcher.Add(dialogHandler);
}
}

#region IDisposable Members


public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
return;

}

protected virtual void Dispose(bool managedAndNative)
{
dialogWatcher.Remove(dialogHandler);

dialogWatcher = null;
dialogHandler = null;
}

Wednesday, March 07, 2007

NOVA Code Camp

There will be a Northern Virginia Code Camp on April 14

http://novacodecamp.org

Wednesday, February 07, 2007

Richmond Code Camp

There will be another Richmond Code Camp on Sat. April 28.

http://www.richmondcodecamp.org/default.aspx


For those of you that don't know a Code Camp is really just a one day
conference. There will be five tracks and five sessions. They'll have
breakfast and lunch, and they'll givaway prizes. Best of all it's all FREE.

Hope to see you there.

Trevor

Monday, January 29, 2007

FXCop Custom MSBuild Task

FXCop is great for checking code, and it's easy enough to run the command
line utility from MSBuild. This will run the analysis and produce a report
of all the issues, but this has no "teeth", that is, nothing makes anyone
look at the report and fix the issues. In order to have FXCop actually
break the build you need to write a custom task the following is an example
of a simple task that breaks the build if there are any issues. It does
need to be told where to find the report via the report location property


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Build.Tasks;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
using System.IO;
using System.Reflection;
using System.Diagnostics;
using System.Xml;

namespace Framework.Build.CustomTasks
{
public class CheckFXCop : Task
{


private string _reportLocation;


[Required]
public string ReportLocation
{
get { return _reportLocation; }
set { _reportLocation = value; }
}

/// <summary>
/// Executes the Task
/// </summary>
/// <returns>true if the task successfully executed; otherwise,
false.</returns>
public override bool Execute()
{

bool returnVal = true;
int numIssues = 0;

try
{

FileStream xmlFileStream = new
FileStream(this.ReportLocation, FileMode.Open);

XmlTextReader fxReport = new XmlTextReader(xmlFileStream);

while (fxReport.Read())
{

if (fxReport.LocalName == "Issue")
{
returnVal = false;
numIssues++;
}


}

if (!returnVal)
{

Log.LogError("There are " + numIssues.ToString() + "
FXCop issue(s). Please review the report");

}


return returnVal;

}
catch
{
return false;

}

}


}
}

Thursday, January 25, 2007

Handling alerts in WATIN

Update: I posted a response awhile ago as a new blog entry http://tmichealson.blogspot.com/2007/03/use-once-dialog.html



One of the most common user interaction on a website is the javascript
"alert" funcions.
With a syntect of:

alert('message');

This function displays a message to the user and requires that they click a
button labeled OK before continuing.

Creating an automated test for a website that uses this poses a couple of
problems. First the is no DOM object
for the window, and second the window runs under a different thread then the
main browser window. Luckly any
web automation tool worth its salt will address both these issues and WATIN
is no exeption. The following code is an
example of how to use the alertdialog handler.


using( IE ie = new IE("http://hostname/pagename.htm"))
{


AlertDialogHandler alertDialogHandler = new AlertDialogHandler ();
using (new UseDialogOnce(ie.DialogWatcher, alertDialogHandler ))
{


/*************************************
* -- code to generate alert -- *
* *
* must use the "nowait" to allow *
* the code to goto the next line *
* *
*************************************/

alertDialogHandler.WaitUntilExists();


alertDialogHandler.OKButton.Click();

IE.WaitForComplete();

}

}

Wednesday, January 24, 2007

WATIN vs WATIR

I've been messing about with WATIR for awhile now and am very impressed. Very powerful, very flexible and I love any excuse to learn a new language (ruby). However, most of my coworkers do not share my thirst for knowledge. Nobody seamed interested in the amazing things that I was doing. Guess they were to busy getting the bug count down, forget that what I'm doing could keep it from getting high in the first place. Knowing this I've moved on to WATIN which so far seems to have most of the same features comes with an IDE and intellisense. Oh and lets not forget the US Navy and its list of approved software. The couple of DLLs that make up watin can be included in a project, but I don't think that an entire interpreter could be thought of in the same way.

New Blogger

So I'm on the new blogger now. To be honest, I'm not sure what that means exactly. But hey, if it's new it must be better right?

Monday, January 22, 2007

Super Hero Results

Your results:
You are Green Lantern
























Green Lantern
70%
Iron Man
70%
Spider-Man
70%
The Flash
65%
Catwoman
60%
Hulk
60%
Superman
60%
Robin
47%
Supergirl
40%
Batman
30%
Wonder Woman
20%
Hot-headed. You have strong
will power and a good imagination.


Click here to take the Superhero Personality Test

Wednesday, December 27, 2006

OpenXML The new Default format for Office 2007


> Despite my classification as a Developer at work, I often find myself
> doing research projects. In this case I was told to research how to
> generate Office Documents from the server. Then I'll have to write a
> whitepaper and do presentation. So far my research has lead me direclty
> to OpenXML the new default format for Office 2007. Now mind you there is
> no way on god's green earth that we will migrate to office 2007 but I'm of
> the opinion that we should use the format anyway. So I'll be spending the
> next couple of weeks writing a paper and trying to convience everyone
> (including myself) that OpenXML is the greatest thing since the invension
> of the wordproccesor.
>
> In case I acutlly have readers I'm gonna post some links and maybe the
> whitepaper when it done.
>
> T.
>
>
> MSDN Magazine: Server-Side Generation of Word 2007 Docs
>
> <http://msdn.microsoft.com/msdnmag/issues/06/11/BasicInstincts/>
> MSDN: Walkthrough: Word 2007 XML Format
> <http://msdn2.microsoft.com/en-us/library/ms771890.aspx>
> MSDN: Introducing the Office (2007) Open XML File Format
> <http://msdn2.microsoft.com/en-us/library/aa338205.aspx>
> ECMA: Office Open XML Overview
> <http://shrinkster.com/ku8>
>

Monday, November 20, 2006

Linerider

This is sweet! I’m so not getting any work done this afternoon

 

http://www.linerider.com/

 

 

T

Friday, November 17, 2006

Wrestling Season take 2

So, we had what I think is called a Nor’easter yesterday and they cancelled school activities so today will be my first day of practice

 

T

Thursday, November 16, 2006

Wrestling Season

I take up the post of Head Wrestling Coach at Hugo Owens Middle School today.

It’s going to be me and 50+ 7th and 8th graders.  May god have mercy on my soul.

 

 

T

Thursday, November 09, 2006

.Net 3.0 Released!

.Net 3.0, however poorly named, was released to market with full support today.  To bad the US Navy seams content to use Windows 2000 till the end of all time, maybe someday I’ll get to be cutting edge. Anyway, check it out.

 

http://www.netfx3.com

 

 

T

Tuesday, October 31, 2006

My Virtual PC Woes

I love Virtual PC. It's a great place to install betas and screw with all kinds of OS features without fear of destroying your computer. But whenever I run a windows operating system on a virtual pc it runs slow. So slow that I can't really perform anything; well I've just read the single most important virtual machine performance tip and as it happens I just bought a new hard drive on sale. So, when I get home I'll installing that baby and moving my VHDs to it. I'll post again with any performance boosts

 

T

My Virtual PC Woes

I love Virtual PC <http://www.microsoft.com/windows/virtualpc/default.mspx>.
It's a great place to install betas and screw with all kinds of OS features
without fear of destroying your computer. But whenever I run a windows
operating system on a virtual pc it runs slow. So slow that I can't really
perform anything; well I've just read the single most important virtual
machine performance tip
<http://www.codinghorror.com/blog/archives/000714.html> and as it happens I
just bought a new hard drive on sale. So, when I get home I'll installing
that baby and moving my VHDs to it. I'll post again with any performance
boosts.

T

Thursday, October 12, 2006

Ubuntu Linux

I'm a windows guy.  Always have been always will be.  However, I like to see what the other side is like now and again.  Usually when I want to scratch my Unix itch I turn to my old friend FreeBSD  this is the Unix I used in collage and the one I'm most familiar with.  This time though I heard about  Ubuntu and their live CD, and I've got to tell you I'm really impressed.  While I never really considered the actuall install process for Unix/Linux to be more difficult then Windows the configuration of Xwindows and the either the KDE or GNOME desktops can be quite a pain, VI and I don't get along.  Ubuntu on the other hand has made the entire install and configuration so simple I'd go so far as to say it's easier then a windows install.  They call it "Linux for human beings" and it lives up to its name.

If you'd like to play with the penguin for awhile here's the scoop:

First goto www.ubuntu.com and download the desktop ISO image,
and burn it to CD

At this point you have several options

Super Cool No Risk Ubuntu preview from Live CD
    -Boot your machine from the CD
    -Ubuntu will load into memory and allow you full access to the entire OS.  This includes by default the GNOME desktop so even the most die hard of windows zealots should feel comfortable.
    The OS will not mount your Hard Drive so there is no risk of corrupting your current system.

Full Installation
    If you have a spare machine, some unformatted space on your hard drive, or like me want to run from a Virtual PC simply boot as before and click the install icon from the desktop.
    A wizard will walk you through all steps needed to configure user accounts and netwoking


Ubuntu comes with a host of Free software pre-loaded the CD it really is a complete package, here's a small list of the included software:

FireFox (Web Browser)
Evolution (Mail and Calendar)
OpenOffice (Word Processor, Spreadsheet, Presentation, etc..)
GIMP (Photo Editor)
Games
Multi-media Players


I Say Check it out.  Catch Ya Later

T