-
jexcel API question!
I have an assignment to write two java programs. One creates and excel file and one reads from an existing excel file. I downloaded "jexcelapi" and tried to create a java program that they have in their tutorial section. The following is the code:
Code:
import java.io.File;
import java.util.Date;
import jxl.*;
import jxl.write.*;
public class ExcelWrite
{
public static void main(String[] args)
{
WritableWorkbook workbook = Workbook.createWorkbook(new File("output.xls"));
WritableSheet sheet = workbook.createSheet("First Sheet",0);
Label label = new Label(0,2,"A label record");
sheet.addCell(label);
Number number = new Number(3,4,3.1459);
sheet.addCell(number);
workbook.write();
workbook.close();
}
}
I get about 6 errors when I compile the program... Mainly, they say that the objects Label, Number, WritableWorkbook and WritableSheet. Here is the link to the tutorial section of the API:
Java Excel API Tutorial
Can anyone tell me what I am doing wrong? Why am I getting those errors?
-
Re: jexcel API question!
Have you added the JExcel jar to your classpath?
When you get errors post the full and exact error message.
-
Re: jexcel API question!
No i haven't.. how do i do that? I will post the errors if I still have any after I add the jar to my classpath
-
Re: jexcel API question!
If you are using an IDE use the help function to find how to do it.
If you are not using an IDE use Google to find info on how to update your classpath.