• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Open a new worksheet using jExcel

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 26946
83
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 26946
83
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic