wood burning stoves*
The moose likes Other Open Source Projects and the fly likes Open a new worksheet using jExcel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Open a new worksheet using jExcel" Watch "Open a new worksheet using jExcel" New topic
Author

Open a new worksheet using jExcel

Kalai Selvi
Ranch Hand

Joined: Jan 08, 2007
Posts: 45
I want to create and open a new excel workbook from java program. I am using JExcel API.
I use

Writableworkbook = Workbook.createWorkbook(new File("fileformat.xls"));

fileformat.xls is the name of the file i want to create.

This function returns a Writableworkbook.

It gets created, i am able to create new sheets in this workbook and check the number of sheets using system.out.print.

But, i am not able to see the file physically. It is not created anywhere.
My requirement is that the newly created file must open up.

Please help me.
Thanks,
Kalai
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

So: you read the file into memory. That's step 1. Then you made some changes to it in memory. That's step 2. But you're missing step 3, which is to write the workbook out to a file. Looking at the API documentation I can see a method that does that.
Kalai Selvi
Ranch Hand

Joined: Jan 08, 2007
Posts: 45
Do you mean the following method :

writableWorkbook.setOutputFile(new File("fileformat.xls"));

where fileformat.xls is the name of the workbook i am creating.

I tried this earlier itself. It gives me the

Warning: Rewriting a workbook with non-empty data

Am i missing out anything else?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I know nothing about jExcel. But I tracked its API documentation down on the internet. I see the class you're asking about has a write() method. Is that not what you want?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Open a new worksheet using jExcel
 
Similar Threads
Cross referencing of excel sheets in jxl
excel
importing data from database to excel sheet through JExcel Api
JEXCEL copy a File , cannot able to open ?
JEXCEL Problem in copying a work book?