Menu

#25 Issues while generating MPX file in MS.NET using mpxj dll

open
nobody
None
7
2013-04-23
2013-04-23
No

Hi,

I have Calendars,Tasks and its dependency relations,am trying to generate an MPX file in Ms.Net

using mpxj dlls. I have downloaded mpjx distribution and added dlls as reference to my Ms.NET

project from lib.net folder as specified in the below link

http://mpxj.sourceforge.net/howto-dotnet.html

In my code i have created a class instance for ProjectFile like
ProjectFile project = new ProjectFile();

Now i am trying to add Tasks to above mentioned project file, here i am facing issues while

setting up ID (Decimal or integer) and DateTime fields for the task.

As mentioned in the above link In the .Net version of the API, in most cases we will find that

.Net properties are available, so the Java style methods do not need to be used.

String text = task.Text
task.Text = text;

But am getting getter and setters like task.setID() and task.setStart()

and While assigning IDs and Datetime fileds i am having issues as described below.

1.Here am trying to assign IDs for Task

task.setID(1) or task.setID(Convert.ToInt16(1))
Error: net.sf.mpxj.Task.setID(java.lang.Integer) has some invalid arguments.
or task.setID((java.lang.Integer)1)
Error: Cannot convert type INT to java.lang.Integer

  1. When i am trying to assign Date properties

task.setStart(System.DateTime.Now) or task.setStart(System.DateTime.Now.Date);
Error: net.sf.mpxj.Task.setStart(java.Util.Date) has some invalid arguments.

Please suggest me how can i overcome these issues? and it would be helpful to me if u provide

sample code in Ms.net .

For you reference Please find the attachment of my sample project.

PS: Please suggest me how to add Name, Start and End dates to project.

1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB