Site icon bVisual

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:

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

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

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 …

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

 

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.

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

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.

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))

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.

I 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.

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…

Exit mobile version