Jim Rogers

Lives in Baton Rouge, LA, with two dogs, one cat, and one lovely wife. I'm a lead developer for GCR Incorporated.

Katrin and Jim

Month List

Hyperlink custom control for TFS

by Jim May 11, 2010 7:41 PM

The Custom Controls for TFS Work Item Tracking site on CodePlex has a couple of useful controls for your TFS work item forms. I need a link on our form which points to an external site that interfaces with TFS. And I needed to add parameters to this link, in order to transfer the work item id to the external site.hyperlink

My answer to this is a hyperlink custom control, which I added to the WITCustomControls project from the CodePlex link above.

To compile, install, and use this Hyperlink control, download the source files and add them to the CodePlex project. Follow the installation instructions there. The XML to include in your work item template looks like this:

<Control FieldName="System.Id" 
  Name="MyLink1"
  Type="HyperLinkControl" 
  Label="Some Page" 
  LabelPosition="Left"
  LinkText="Some Page"
  URL="http://MyServer/SomePage.aspx" 
  ParamNames="id,date" 
  ParamFields="System.Id,System.ChangedDate" />

The ParamNames list is optional; if not included, the control will use the field names for the URL parameter names.

Tags: ,

Code

SSIS decimal output formatting

by jim May 11, 2010 2:56 PM

Do you need to get your SSIS output to convert numbers to strings, with a specific number of decimal places? I needed my derived columns to be blank if the number is zero, or show as money (2 decimals places) if not.

Converting to decimal has no effect; the output does not show a fixed number of digits after the zero.

Amount < 0 ? (DT_WSTR,20)(DT_DECIMAL,2)(0 - Amount) : ""

The trick is to convert to DT_NUMERIC, instead. The conversion to DT_WSTR will then include zeros to pad to the desired scale. (Scale is the number of decimal places, and precision is the total number of digits.)

Amount > 0 ? (DT_WSTR,20)(DT_NUMERIC,15,2)(Amount) : ""

Tags:

Code