Results 1 to 7 of 7
  1. #1
    priyankabhar is offline Member
    Join Date
    Jul 2007
    Posts
    1
    Rep Power
    0

    Default writing to a excel file from java program

    Hi,

    I want to create and write to a excel file from a java program. I found a tutorial online and wrote a java file as under:

    Java Code:
    import java.io.File;
    import java.util.Date;
    import jxl.*;
    import jxl.write.*;
    
    public class jExcel{
    
    	WriteableWorkbok workbook = Workbok.createWorkbook(new File("output.xls"));
    
    	public static void main(String args[]){
    		WriteableSheet sheet = workbook.createSheet("First Sheett",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();
    	}
    }
    But when I compile this file, I get errors telling that package jxl does not exists and so on. Do I need to download it ? I am really new to it but I need to do the job. Please give some ideas.

    Thanks,
    Priyanka
    Last edited by JavaBean; 07-10-2007 at 08:18 PM. Reason: Code is placed inside [code] tag.

  2. #2
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

    Default

    You can download from here
    SourceForge.net: Files

  3. #3
    Cortexiphan is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default

    When I follow the link, and I select JexcelAPI it shows me several different versions.

    Do I just download the newest one?

  4. #4
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    3

    Default

    I'd just like to point out that any package NOT starting with one of these:
    java.
    javax.

    is a custom/community package i.e. not standard and thats why you will need to download them yourself

    also its usually best to download the latest and most stable version. look for user feedback and if the latest version doesnt have any serious bugs then you should use that one.

  5. #5
    only_java is offline Member
    Join Date
    Mar 2011
    Posts
    16
    Rep Power
    0

    Default

    For creating .xls files from java. One of the good API is jXl API.
    You can find more details from following URL
    JExcelApi

  6. #6
    basavaraj4375 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Re: writing to a excel file from java program

    Can someone please tell what is the equivalent for Label in Apache Poi???


    Thanks,
    Basavaraj

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    10,481
    Rep Power
    16

    Default Re: writing to a excel file from java program

    Aren't they just Cells with a cell type of CELL_TYPE_STRING?
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Reading data from Micrsoft excel and writing to notepad
    By abhishek.jain in forum New To Java
    Replies: 4
    Last Post: 01-29-2009, 08:12 AM
  2. Replies: 0
    Last Post: 04-04-2008, 02:45 PM
  3. Help needed writing a program...
    By Francis in forum New To Java
    Replies: 2
    Last Post: 11-22-2007, 02:03 PM
  4. writing to a file
    By bugger in forum New To Java
    Replies: 1
    Last Post: 11-11-2007, 02:49 AM
  5. Poblem in Compiling a c++ file from a java program...
    By Amit Kr. Mishra in forum New To Java
    Replies: 0
    Last Post: 11-06-2007, 10:41 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
  •