Click here to Skip to main content
15,881,831 members
Articles / Web Development / ASP.NET
Article

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

Rate me:
Please Sign up or sign in to vote.
3.07/5 (10 votes)
3 Sep 20073 min read 305.1K   2.6K   27   21
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


Written By
Web Developer
Malaysia Malaysia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionSimplier option Pin
booyah01215-Jun-16 17:07
booyah01215-Jun-16 17:07 
GeneralRe: Simplier option Pin
PIEBALDconsult15-Jun-16 17:09
mvePIEBALDconsult15-Jun-16 17:09 
Questionread an MsProject file in my application Pin
anas chahti19-Nov-14 22:53
anas chahti19-Nov-14 22:53 
QuestionAdding a custom column in MS Project application using Asp.net Pin
hemantghorpade25-Nov-13 20:22
professionalhemantghorpade25-Nov-13 20:22 
GeneralMy vote of 3 Pin
hemantghorpade18-Nov-13 22:17
professionalhemantghorpade18-Nov-13 22:17 
The given solution is ultimate but my requirement is different.I have to open Microsoft Project into the application as grid appears not outside the application.Another thing is Resource drop-down is multiple selection but my requirement is only one selection at a time
GeneralEncountered Error: "This is not a valid field name." Pin
Kindson Munonye2-May-11 8:03
Kindson Munonye2-May-11 8:03 
QuestionReading .MPP file Pin
YOGESH DHAGE17-Mar-11 20:57
YOGESH DHAGE17-Mar-11 20:57 
GeneralMy vote of 4 Pin
guanx16-Aug-10 22:58
guanx16-Aug-10 22:58 
GeneralMisunderstood ASP.NET Code: Pin
eashwar v9-Nov-09 2:09
eashwar v9-Nov-09 2:09 
GeneralRe: Misunderstood ASP.NET Code: Pin
mahmoudgebriel21-Dec-09 3:59
mahmoudgebriel21-Dec-09 3:59 
QuestionDisplay Resource Usage sheet on the webpage Pin
Raja S Veeramalla1-Nov-09 22:37
Raja S Veeramalla1-Nov-09 22:37 
Generalrecupere data from MS Project Pin
maryyem17-Jul-09 22:04
maryyem17-Jul-09 22:04 
GeneralProblem while running the application from IIS Pin
VasuJoe4-Jun-09 23:40
VasuJoe4-Jun-09 23:40 
Generalhelp Urgent project server 2003 Pin
dguevaras13-May-09 12:14
dguevaras13-May-09 12:14 
QuestionDo NOT Work in VS.Net 2005 ? Pin
Mehrdad Mirsamie1-Nov-08 19:30
Mehrdad 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? Pin
nabber14-Aug-08 19:51
nabber14-Aug-08 19:51 
QuestionVisual Studio 2008 required? Pin
MikeAiello15-Apr-08 11:37
MikeAiello15-Apr-08 11:37 
Questionweb server setup required? Pin
MERainey1519-Oct-07 12:03
MERainey1519-Oct-07 12:03 
AnswerRe: web server setup required? Pin
ihsanps14-Nov-07 16:53
ihsanps14-Nov-07 16:53 
AnswerRe: web server setup required? Pin
ihsanps14-Nov-07 16:54
ihsanps14-Nov-07 16:54 

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

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