<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ashish's Tech Blog &#187; MPXJ Read MPP</title>
	<atom:link href="http://www.ashishpaliwal.com/blog/tag/mpxj-read-mpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ashishpaliwal.com/blog</link>
	<description>From Programmer, For Programmers</description>
	<lastBuildDate>Tue, 17 Aug 2010 12:04:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>[MPXJ Series] Reading MS Project Files using MPXJ</title>
		<link>http://www.ashishpaliwal.com/blog/2008/12/mpxj-series-reading-ms-project-files-using-mpxj/</link>
		<comments>http://www.ashishpaliwal.com/blog/2008/12/mpxj-series-reading-ms-project-files-using-mpxj/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 09:06:43 +0000</pubDate>
		<dc:creator>ashish</dc:creator>
				<category><![CDATA[Application Programming]]></category>
		<category><![CDATA[MPXJ Read MPP]]></category>

		<guid isPermaLink="false">http://www.ashishpaliwal.com/blog/?p=235</guid>
		<description><![CDATA[It’s been a while since my last post on using MPXJ. You can find it here. Since then have been observing the search items and have found that need to have some simple posts related to MPXJ. So starting a series on MPXJ, which I shall keep updating as and when I learn more about [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a while since my last post on using MPXJ. You can find it <a href="http://www.ashishpaliwal.com/blog/2008/10/updating-google-calendar-with-ms-project-tasks/">here</a>. Since then have been observing the search items and have found that need to have some simple posts related to MPXJ. So starting a series on MPXJ, which I shall keep updating as and when I learn more about it.</p>
<p>In the first part, let’s explore what are the different ways of reading a MPP file in MPXJ.</p>
<p><strong>Pre-requisite</strong></p>
<p>The article assumes that you have downloaded MPXJ release and related dependencies. If not here are the links for download</p>
<ul>
<li>MPXJ - http://sourceforge.net/project/showfiles.php?group_id=70649</li>
<li>Dependencies - http://mpxj.sourceforge.net/dependencies.html</li>
</ul>
<p>Now let’s get back to the original intent of reading MPP files</p>
<p>Lets see the simplest form of reading an MPP file</p>
<pre class="java5"><span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
     ProjectReader reader = ProjectReaderUtility.<span style="color: #006600;">getProjectReader</span><span style="color: #66cc66;">&#40;</span>fileName<span style="color: #66cc66;">&#41;</span>;
     ProjectFile projectFile = reader.<span style="color: #006600;">read</span><span style="color: #66cc66;">&#40;</span>fileName<span style="color: #66cc66;">&#41;</span>;</pre>
<pre class="java5">     <span style="color: #808080; font-style: italic;">// ... process Project file here</span>
<span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
     e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>ProjectReaderUtility.getProjectReader(), provides an appropriate Reader class, based on the version of MS Project file. This is the simplest way to read an MPP file. ProjectFile is the class that contains details about the Schedule, we can iterate and extract information from it.</p>
<p><strong>Alternative ways</strong></p>
<ul>
<li>For reading MPX file, you can use net.sf.mpxj.mpx.MPXReader</li>
<li>For reading MPP,MPT file, use net.sf.mpxj.mpp.MPPReader</li>
<li>For reading MSPDI, use net.sf.mpxj.mspdi.MSPDIReader</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ashishpaliwal.com/blog/2008/12/mpxj-series-reading-ms-project-files-using-mpxj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
