MPXJ 在资源上设置 24 小时日历
我正在使用 MPXJ 框架生成一个 XML 文件,并将其导入到项目 2007 中。我遇到了一些问题,但我似乎找不到以下问题的答案。
我的任务有固定的工时和持续时间,但是当我添加资源并将其导入项目中时,我收到一条错误消息:
“该资源是在项目中任务 2 的原始日期之外分配的。此固定持续时间的持续时间任务将发生变化以适应资源分配”。
然后,Project 会更改工时和/或工期值。那不是我想要的。我希望资源使用 24 小时日历,但我似乎无法附加项目 2007 年标准日历,所以我想让我自己制作 24 小时日历并将其附加到资源。现在我似乎无法在工作日中设置 0:00:00 到 0:00:00 时间。
ProjectCalendar calendar = projectFile.addResourceCalendar();
calendar.setName("24 Hours");
calendar.setUniqueID(Count);
calendar.setWorkingDay(Day.MONDAY, true);
calendar.setWorkingDay(Day.TUESDAY, true);
calendar.setWorkingDay(Day.WEDNESDAY, true);
calendar.setWorkingDay(Day.TUESDAY, true);
calendar.setWorkingDay(Day.FRIDAY, true);
Resource resource = projectFile.addResource();
resource.setUniqueID(Count);
resource.setName("Painters");
resource.setResourceCalendar(calendar);
任何人都知道一种解决方案,可以将默认的 24 小时日历设置为我自己的资源。
I am working with MPXJ framework to generate an XML file with i import into project 2007. I have run in to allot of problems but i can't seem to find an answer to the following.
I have a fixed Work and duration on a task, but when i add a resource and import it in project i get an error message:
"The resource is assigned outside the original dates for task 2 in project. The duration of this fixed-duration task will change to accommodate the resource assignment".
Project then changes the work and or duration value. that is not what i want. i want the resource to use the 24 hours calendar but i can't seem to attach the project 2007 standard calendar, so i thought lets make my own 24 hours calendar and attach that to resource. now i can't seem to set the 0:00:00 to 0:00:00 time in a work day.
ProjectCalendar calendar = projectFile.addResourceCalendar();
calendar.setName("24 Hours");
calendar.setUniqueID(Count);
calendar.setWorkingDay(Day.MONDAY, true);
calendar.setWorkingDay(Day.TUESDAY, true);
calendar.setWorkingDay(Day.WEDNESDAY, true);
calendar.setWorkingDay(Day.TUESDAY, true);
calendar.setWorkingDay(Day.FRIDAY, true);
Resource resource = projectFile.addResource();
resource.setUniqueID(Count);
resource.setName("Painters");
resource.setResourceCalendar(calendar);
Any one know of a solution to one get the default 24 hour calendar set to the resource of make my own.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面的代码说明了如何创建 24 小时日历。对于每天设置的冗长方式,我深表歉意,我需要改进 Day 类的工作方式,以便更容易迭代。
需要注意的关键点是,DateRange 实例设置为在某个日期的 00:00 开始,并在第二天的 00:00 结束。。实际使用的日期无关紧要,日历仅使用日期的时间元素。
希望这是有道理的!
The code below illustrates how to create a 24 hour calendar. My apologies for the long-winded way each day is set up, I need to improve the way the Day class works so that it is easier to iterate.
The key point to note is that the DateRange instance is set up to start at 00:00 hours on one date, and finish at 00:00 hours on the following day. The actual date used is irrelevant, the calendar is only using the time element of the date.
Hope that makes sense!