View Single Post
  #1 (permalink)  
Old 07-10-2007, 08:34 PM
priyankabhar priyankabhar is offline
Member
 
Join Date: Jul 2007
Posts: 1
priyankabhar is on a distinguished road
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:

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 09:18 PM. Reason: Code is placed inside [code] tag.
Reply With Quote
Sponsored Links