Export to Microsoft project Xml and Mpx Fomat for Microsoft Project Plan RRS feed

  • Question

  • I have created a custom planning application which is a windows application using C#. I want to provide a facility of Export to Mpx to the user so that the user can extract the plan from my custom application and view the same in Microsoft Project Plan.

    I have all my data in form of datasets and datatables. How do I code for such a functionality. I am unable to find a standard way of doing the same.

    I have downloaded the Microsoft Project SDK from the site The approach that I have presently used is

    • Create a dataset on the schema exposed in the SDK
    • Serialized the dataset to xml and created a XML file.

    Next part would be to somehow convert the xml to mpx. Presently I am unable to get the correct xml generated. The xml file that gets generated is not loading correctly in the Microsoft Project Plan.

    Also I am unable to find a way to convert the xml to mpx. I am adding the sample xml that I have been able to generate.'

    <NewDataSet xmlns=""><Project><SaveVersion>12</SaveVersion><UID>19</UID><Title>New Project Plan</Title><Subject>New Project Plan for testing Advanced Planning Functionality</Subject><ScheduleFromStart>true</ScheduleFromStart><StartDate>2012-03-01T08:00:00</StartDate><FinishDate>2012-03-02T08:00:00</FinishDate><CurrencyCode>$</CurrencyCode><DefaultTaskType>1</DefaultTaskType><DurationFormat>5</DurationFormat><EditableActualCosts>false</EditableActualCosts><HonorConstraints>true</HonorConstraints><InsertedProjectsLikeSummary>true</InsertedProjectsLikeSummary><MultipleCriticalPaths>false</MultipleCriticalPaths><NewTasksEffortDriven>true</NewTasksEffortDriven><NewTasksEstimated>true</NewTasksEstimated><SplitsInProgressTasks>true</SplitsInProgressTasks><SpreadActualCost>true</SpreadActualCost><SpreadPercentComplete>false</SpreadPercentComplete><MoveCompletedEndsBack>false</MoveCompletedEndsBack><MoveRemainingStartsBack>false</MoveRemainingStartsBack><MoveRemainingStartsForward>false</MoveRemainingStartsForward><MoveCompletedEndsForward>false</MoveCompletedEndsForward><AutoAddNewResourcesAndTasks>true</AutoAddNewResourcesAndTasks><Tasks /><Tasks /><Tasks /><Tasks /><Tasks /><Tasks /><Tasks /><Tasks /></Project><Task><UID>60</UID><ID>60</ID><Name>Basline Tracking View</Name><OutlineNumber>1</OutlineNumber><Start>2012-03-01T08:00:00</Start><Finish>2012-03-02T09:00:00</Finish><Summary>true</Summary><Critical>true</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>100000000000000091</UID><ID>100000000000000091</ID><Name>UI Coding - Delete Baseline</Name><OutlineNumber>1.1</OutlineNumber><Start>2012-03-01T08:00:00</Start><Finish>2012-03-01T13:39:00</Finish><Summary>false</Summary><Critical>false</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>57</UID><ID>57</ID><Name>Middle Tier Coding - Basline Tracking View</Name><OutlineNumber>1.2</OutlineNumber><Start>2012-03-01T08:00:00</Start><Finish>2012-03-01T10:30:00</Finish><Milestone>false</Milestone><Summary>false</Summary><Critical>true</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>56</UID><ID>56</ID><Name>UI Coding - Baseline Tracking View</Name><OutlineNumber>1.3</OutlineNumber><Start>2012-03-01T10:30:00</Start><Finish>2012-03-01T16:30:00</Finish><Summary>false</Summary><Critical>true</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>58</UID><ID>58</ID><Name>UI Coding - Change Update Baseline functionality</Name><OutlineNumber>1.4</OutlineNumber><Start>2012-03-01T10:30:00</Start><Finish>2012-03-01T13:30:00</Finish><Summary>false</Summary><Critical>false</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>59</UID><ID>59</ID><Name>Peer Review - Baseline Tracking View</Name><OutlineNumber>1.5</OutlineNumber><Start>2012-03-01T16:30:00</Start><Finish>2012-03-02T09:00:00</Finish><Milestone>true</Milestone><Summary>false</Summary><Critical>true</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>61</UID><ID>61</ID><Name>WBS View</Name><OutlineNumber>2</OutlineNumber><Start>2012-03-01T08:00:00</Start><Finish>2012-03-01T12:00:00</Finish><Summary>true</Summary><Critical>false</Critical><ConstraintType>0</ConstraintType></Task><Task><UID>62</UID><ID>62</ID><Name>UI Coding - WBS View</Name><OutlineNumber>2.1</OutlineNumber><Start>2012-03-01T08:00:00</Start><Finish>2012-03-01T12:00:00</Finish><Summary>false</Summary><Critical>false</Critical><ConstraintType>0</ConstraintType></Task></NewDataSet>

    Can someone please help me to achieve an export to xml first and then export to xml?




    Monday, March 19, 2012 4:49 AM

All replies

  • The XML format is used with Microsoft Project Server, the MPX format is used by the client application Microsoft Project Professional in a standalone mode. Microsoft Project Professional can read/write both formats, depending on the origin of the data.

    Do you wish to support the standalone Microsoft Project Professional?

    Jan Cirpka

    Monday, March 19, 2012 9:06 AM
  • Yes I want the xml file and the mpx file to be openend in the Microsoft Project Professional that comes inside Microsoft office.
    Monday, March 19, 2012 9:08 AM
  • Hi Vandana,
    the MPX format is very straightforward, you just have to be meticulous.
    It is a straight text/ASCII file, with a very specific syntax.
    The specification for the MPX format can be found here: support (and a dot) microsoft (and a dot) com/kb/270139

    A simple sample file would look like below. It is based on a few header rows, the first one is mandatory,
    and then if you want some headers relating to setting date format, currency etc. etc.
    Each file is based on the syntax "<header type><delimiter> ...... " where header type is a numeral,
    and for instance comment rows has the header type "0". I have chosen ";" as my delimiter, thus
    "0; .... " are comment rows below.
    When the header rows are completed, you add a lot of "70;...." -rows for your tasks. The syntax of
    these is something you yourself set in the "61;..." -row, where you determine which fields and in which
    order the "70;...." -rows will follow. Yuo have access to virtually all project filed, such as Flag1... Text...,
    Duration, Actual Start, Start, Start1... you name it.

    If you name your file "..... .MPX" you can simply double-click it an it will launch in Project.
    Good luck!

    MPX; Microsoft Project 3.0
    0;2=YMD; 1=24hrs; 08:00 = 480 minutes after midnight;- date separator; : time separator
    30;;Company;Henrik Lundin;;13-01-01
    0;-; Organisation; Manager; -; Start date
    0;3=Outline level; 1=Name; 70=Predecessors; 4=Text1; which is used for subproject name; 58=Actual start; 40=Duration; 44=% Complete
    70;1;The first master task;;Sales
    70;2;1-Subtask one;;Sales;13-01-10;20;2070;2;1-Subtask two;2FS+0d;Marketing;13-01-15;40;30
    70;2;1-Subtask no three;3FS+0d;Sales;13-01-28;15;85

    Kind regards,
    Henrik from Sweden

    Tuesday, February 5, 2013 7:33 AM
  • See my reply for previous post, Project 2013 no longer imports mpx. Save your data as xml. In Proejct save a simple project to xml to get the format.

    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Wednesday, February 6, 2013 4:17 AM