Creating Linked Timelines From Project

A recent newsgroup question asked if it is possible to create shapes in Visio 2007 that are linked to tasks in a timeline in Project …. without lots of coding!  Well, that sounds like a challenge that I can’t resist, so here goes!

First, I am using Microsoft Project 2007 and I have loaded the Commercial Construction sample project that is in the Visio SDK.

image

The first part of the process is to export the project to a suitable format that can be used as a data source in Visio 2007 Pro.  I chose to Save As a Microsoft Excel Pivot Table, and selected the Tasks type of data.  I then chose to Base on Table … Rollup Table:

image When the export has finished, you will get a workbook with two worksheets.  The second one contains a pivot table…

image … but the first one contains a table that we can use as a data source in Visio:

image Next, I started a new blank document in Visio, and changed the Page Setup to be:

  • Print Setup / Printer paper = Landscape
  • Drawing Scale / Pre-defined scale = Metric / 1 : 2.5
  • Page Properties / Measurement units = Days

I then selected Data / Link Data to Shapes, and selected the Excel Workbook that I just created, and chose Task_Table1$ as the range.  I selected Next, accepting the default for the Columns and Rows, but I added Resource_Names to the Unique Identifier, as well as the ID …

image

After selecting Finish on the Data Selector, I dragged the first record onto the empty page, and dropped it.

image 

I ensured that I had Developer Mode ticked in Tools / Options / Advanced.  Then I defined a new Shape Data row, called EarliestDate, for the page.  This needs to be set as a Date Type row.

image I then entered the date that is one day less than that in my project.

image I then resized the rectangle and edited its Data Graphic to display a few of the fields, and I used the Resource_Names as Color By Value.

image

I then opened the ShapeSheet of the rectangle, and amended the following cell formulas:

  • LocPinX = 0
  • PinX=GUARD((Prop._VisDM_Start_Date-ThePage!Prop.EarliestDate)*(ThePage!PageScale/ThePage!DrawingScale))

image

I then altered the X fomulas in the second and third rows of the Geomtery1 section with the following:

=GUARD((Prop._VisDM_Finish_Date-Prop._VisDM_Start_Date)*(ThePage!PageScale/ThePage!DrawingScale))

This has the effect of altering the width of the coloured rectangle, without changing the width of the shape.  This is important because the width of the Visio 2007 Data Graphic is linked to the width of the shape …. something that has been fixed in Visio 2010.

I then opened the Shapes Document Stencil so that I could drag the Data Linked rectangle onto it.

imageI then renamed this Master as Resource Task, and ticked Match master name on drop.

I then deleted the existing Rectangle master … it is no longer needed.

I could then select the new Master, and drag and drop rows from the External Data window onto the page, knowing that the horizontal position is linked to the start date, and the width of the coloured rectangle is linked to the duration.

image Okay, I played with the scale and width of the master a little, until I was happy, and I have not yet created a header shape for the timeline, but I think this blog answered the original question…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

davecra.wordpress.com/

Microsoft Office Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: