0

`

Inline Code Example Here

`

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"%>
 <html>
<head>   
 <%@ page import="java.io.*"  %>

<%@ page import="java.io.*"  %>
<%@ page import ="net.sf.mpxj.MPXJException " %>
 <%@ page  import=" net.sf.mpxj.ProjectFile" %>
  <%@ page import=" net.sf.mpxj.Resource" %>
 <%@ page  import=" net.sf.mpxj.Task" %>
 <%@ page  import=" net.sf.mpxj.mpp.MPPReader" %>
 <%@ page  import ="net.sf.mpxj.reader.ProjectReader"  %>

<title>Insert title here</title>
</head>
<body>


<%
final class Mpx 
{

      public void mppReader()
      {
          ProjectReader reader = new MPPReader();
          ProjectFile project;
         System.out.print("before reading");
            try 
            {

                project = reader.read("b4ubuild_sample_2k-03.mpp");
                 //b4ubuild_sample_2k-03
            } 
            catch (MPXJException e)
            {

                e.printStackTrace();
            }

            for (Resource resource : project.getAllResources())
            {

                System.out.println("Resource: " + resource.getName() + " \n(Unique ID=" +resource.getUniqueID() + ")");
                System.out.println("\n");
            }


        for (Task task : project.getAllTasks())
            {
                System.out.println("Task:        " + task.getName() + " ID=" + task.getID() + " Unique ID=" +
            task.getUniqueID()+ "\nStart Date : " +task.getStart()+"\nFinish Date : "+task.getFinish()+ "\nDuration : "
                        +task.getDuration().getDuration());
                System.out.println("\n");
            }

        System.out.println("after reading");
     }
public void main(String[] args)
{
      Mpx fileReader = new Mpx();
      fileReader.mppReader();
}
      }%>
</body>
</html>
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by jalpesh_007
0

can any one help me out i m getting error as
"An error occurred at line: 8 in the generated java file
Only a type can be imported. net.sf.mpxj.MPXJException resolves to a package"

0

have you tried to import net.sf.mpxj.*
if you want to import all folders and file here from the directory mpxj

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.