Results 1 to 4 of 4
  1. #1
    Asvin is offline Member
    Join Date
    Nov 2010
    Posts
    66
    Rep Power
    0

    Default 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:

    Java 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?

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,762
    Rep Power
    7

    Default Re: jexcel API question!

    Have you added the JExcel jar to your classpath?

    When you get errors post the full and exact error message.

  3. #3
    Asvin is offline Member
    Join Date
    Nov 2010
    Posts
    66
    Rep Power
    0

    Default 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

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,762
    Rep Power
    7

    Default 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.

Similar Threads

  1. JExcel Question
    By sciprog2 in forum JDBC
    Replies: 0
    Last Post: 04-14-2011, 05:29 PM
  2. windows CE+ Swing + jexcel api
    By victorroa in forum AWT / Swing
    Replies: 0
    Last Post: 03-21-2011, 03:30 PM
  3. Jexcel in netbeans
    By rekha in forum Web Frameworks
    Replies: 0
    Last Post: 03-24-2009, 12:00 PM
  4. JExcel vs Apache POI
    By Webuser in forum New To Java
    Replies: 1
    Last Post: 12-02-2008, 11:39 PM
  5. Help with JExcel installing
    By Webuser in forum New To Java
    Replies: 0
    Last Post: 12-02-2008, 05:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •