• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

reading multiple sheets using apache POI

 
Ranch Hand
Posts: 842
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



I have above application which reads excel file and prints the content on the console. It is only printing sheet1. I have about 50 sheets. How to print all the 50 sheets on to console.
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's a comment that says: "Get the first sheet from workbook". That's the spot I would start with.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Find the total number of sheets in the workbook. Then run the code for printing a sheet's values within a for loop. ie Repeat for each sheet.


 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What line of that code gets the first sheet from the workbook? How might it be changed to get, I dunno, the second worksheet from the workbook? What methods are available on the API to get the number of worksheets from a workbook?

Listen, I know you have a lot of questions, but as I told you before, 99% of them are answerable if you look at the POI API. There really is good documentation there.
 
Corrie L Sherone
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Luke wrote:Listen, I know you have a lot of questions, but as I told you before, 99% of them are answerable if you look at the POI API. There really is good documentation there.



I second that. POI's API and documentation is very good. The busy developer's guide provides an excellent quick start to most common questions:
http://poi.apache.org/spreadsheet/quick-guide.html
 
sai rama krishna
Ranch Hand
Posts: 842
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sure
 
ice is for people that are not already cool. Chill with this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic