阅读Asta / Power Project时出错

时间:2016-05-31 14:35:22

标签: java ruby mpxj

使用ruby mpxj我在读取asta / power项目文件时出现以下错误

/var/lib/gems/2.3.0/gems/mpxj-5.2.2/lib/mpxj/reader.rb:24:in `read': Failed to read file: Reading input file started. (RuntimeError)
java.lang.UnsupportedOperationException
        at net.sf.mpxj.asta.AstaFileReader.readDatabaseFile(AstaFileReader.java:126)
        at net.sf.mpxj.asta.AstaFileReader.read(AstaFileReader.java:74)
        at net.sf.mpxj.reader.AbstractProjectReader.read(AbstractProjectReader.java:49)
        at net.sf.mpxj.sample.MpxjConvert.process(MpxjConvert.java:81)
        at net.sf.mpxj.sample.MpxjConvert.main(MpxjConvert.java:56)
        from test.rb:3:in `<main>'

ruby​​文件看起来像:

require 'mpxj'

project = MPXJ::Reader.read("asta.pp")

puts "There are #{project.all_tasks.size} tasks in this project"
puts "There are #{project.all_resources.size} resources in this project"

puts "The resources are:"
project.all_resources.each do |resource|
  puts resource.name
end

puts "The tasks are:"
project.all_tasks.each do |task|
  puts "#{task.name}: starts on #{task.start}, finishes on #{task.finish}, it's duration is #{task.duration}"
end

不确定为什么会出现此错误,因为我可以在Asta Project Viewer中查看该程序,因此该文件不得损坏。

1 个答案:

答案 0 :(得分:0)

问题是MPXJ不支持最新的Powerproject文件格式。我希望在接下来的几周内增加这种支持。如果您没有看到任何进展,请直接给我发邮件以提醒我!