Click here to Skip to main content
Click here to Skip to main content
Go to top

Developing MS Project application using Asp.net/VB.net

, 3 Sep 2007
Rate this:
Please Sign up or sign in to vote.
Developing a microsoft project application using asp.net

Introduction

This article give a small idea about how to start developing Microsoft Project application using Asp.net.As you all know microsoft project is tool used for creating schedules for projects.

Background

The new version of Microsoft Office—the 2007 Microsoft Office System—is a great platform on which to build composite applications. This system delivers not just the familiar set of Microsoft Office clients (Office Word, Office Excel, Office InfoPath), but also several key capabilities as services that are delivered on both client applications and the server. These services are not just packaged together into a monolithic unit, but are very compartmentalized (as shown in Figure 1), and each has its own Web services interfaces.

the high-level capabilities in the 2007 Microsoft Office System are listed in the following subsections. Each of these capabilities is a powerful feature, when looked at individually; however, it is the combination of these different technologies into a single integrated platform that makes composition practical. This integration enables delivery and deployment of composite applications without an overwhelming increase in complexity in the overall platform, tooling and, architecture.

Using this artcile i wil give you all small idea how to start developing microsoft project applicatioin using asp.net

Using the code


First Step

Add A reference of microsoft office project 12.0 Object Library

In solution explorer right click and select add reference.Then select COM components
and select microsoft office project 12.0 Object Library.then click OK.


Adding microsoft office project 12.0 Object Library in to visual studio.net using following line of code.

Imports Microsoft.Office.Interop.MSProject

Opening an Existing Project

Here we need to create an instance of Application object,then by using the function FileOpenEX in Application object,we can open the Project which we need to open and using application.visible=true to view the project file.

Dim appclass As New Application
appclass.FileOpenEx("C:\filename.mpp")
appclass.Visible = True


Create an object for interface project by using application.ActiveProject

Dim project As Project = appclass.ActiveProject


Adding A resource to a particular project

the code which need to use to add resources to a project is
project.Resources.Add("A", 1)
project.Resources.Add("B", 2)
project.Resources.Add("C", 3)
project.Resources.Add("D", 4)
project.Resources.Add("E", 5)


Adding tasks to a project


Here ,will give an idea of how to add a task to a particular project.Say for example if we want to add a new task named "Requirment Collection", you can achieve that by using

Dim task As Task = project.Tasks.Add("Requirment Collection")

Now we will assign a start and enddate to particular task.

task.Start = "08/1/2007"
task.Finish = "10/25/2007"

Now we wil add a resource to a particular project by

task.Assignments.Add(task.ID, 1)
task.Assignments.Add(task.ID, 2)

Now we wil set milestone to a project task by

task.Milestone = true/False

Then we need to tell whether this task is a main task or sub task by assigning value to the outline property

task.OutlineLevel

we can assign 1 or 2 or 3 depending the levelling of tasks.

Displaying different View of MS project


By using the project 12.0 library control we can display different type of views like Resource Graph,Network Diagram,Detail Gantt etc.
here is the code to display different type of views by using this line of code.

lets say if we want to show the resource graph

appclass.ViewApply("Resource Graph").

Same way if want to display network diagram we can use

appclass.ViewApply("Network Diagram").

similarly we can use below lines of codes to display different type of views.

appclass.ViewApply("Detail Gantt")
appclass.ViewApply("Leveling Gantt")
appclass.ViewApply("Tracking Gantt")
appclass.ViewApply("Task Sheet")
appclass.ViewApply("Descriptive Network Diagram")
appclass.ViewApply("Relationship Diagram")

Conclusion

In this article we have explored how to open a microsoft project ,adding tasks,adding resources and achieve some other tasks using asp.net.hope you all enjoy it..

About Ihsan

Ihsan is working as microsoft.net programmer for years .currently working in RANN CONSULTING SDN BHD malaysia.Mainly working on web ,mobile and pocketpc using Visual studio.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

ihsanps
Web Developer
Malaysia Malaysia
No Biography provided

Comments and Discussions

 
QuestionAdding a custom column in MS Project application using Asp.net Pinprofessionalhemantghorpade25-Nov-13 20:22 
GeneralMy vote of 3 PinmemberMember 1041095718-Nov-13 22:17 
GeneralEncountered Error: "This is not a valid field name." PinmemberKindson Munonye2-May-11 8:03 
QuestionReading .MPP file PinmemberYOGESH DHAGE17-Mar-11 20:57 
GeneralMy vote of 4 Pinmemberguanx16-Aug-10 22:58 
GeneralMisunderstood ASP.NET Code: Pinmembereashwar v9-Nov-09 2:09 
GeneralRe: Misunderstood ASP.NET Code: Pinmembermahmoudgebriel21-Dec-09 3:59 
QuestionDisplay Resource Usage sheet on the webpage PinmemberMember 45688151-Nov-09 22:37 
Hi,
 
Can we show the resource usage view on the webpage. I'm in the process of developing a web app which will read the MPP and display the tasks of the logged in user. It would be gr8 if u can guide me.
 
Raja Sekhar
Generalrecupere data from MS Project Pinmembermaryyem17-Jul-09 22:04 
GeneralProblem while running the application from IIS PinmemberVasuJoe4-Jun-09 23:40 
Generalhelp Urgent project server 2003 Pinmemberdguevaras13-May-09 12:14 
QuestionDo NOT Work in VS.Net 2005 ? PinmemberMehrdad Mirsamie1-Nov-08 19:30 
Questionwhy the task.start was changed automatically when I set the task.outlineLevel which cause to the task.duration is not value i set it? Pinmembernabber14-Aug-08 19:51 
QuestionVisual Studio 2008 required? PinmemberMikeAiello15-Apr-08 11:37 
Questionweb server setup required? PinmemberMERainey1519-Oct-07 12:03 
AnswerRe: web server setup required? Pinmemberihsanps14-Nov-07 16:53 
AnswerRe: web server setup required? Pinmemberihsanps14-Nov-07 16:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 4 Sep 2007
Article Copyright 2007 by ihsanps
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid