Why do you recommend the low level API? POI has perfectly fine high level APIs.
But let's take a step back: You said you need to import data from Excel, and then print it. So what do you mean by "I am using the POI library for exporting data." - what is the "export" step that you already have?
But regardless, the POI web site has many, many code examples for doing just about anything related to XLS and XLSX files.
Why do you recommend the low level API? POI has perfectly fine high level APIs.
But let's take a step back: You said you need to import data from Excel, and then print it. So what do you mean by "I am using the POI library for exporting data." - what is the "export" step that you already have?
But regardless, the POI web site has many, many code examples for doing just about anything related to XLS and XLSX files.
There was a part in the project which required acquiring data from the database and exporting it in excel sheets.
That is where i used the POI library for exporting.
But now i want to import data from excel and print it.
As I said, the POI site has tons of examples for doing just about anything involving Excel files; have you looked through the "Quick Guide" and "HOWTO" pages?
Be aware that that code only works for XLS files, not XLSX files. If you want something that works for both files, you should use the org.apache.poi.ss.... packages instead of the org.apachepoi.hssf... packages; the code shouldn't be hard to refactor.
Aniketh Narayanan
Greenhorn
Joined: Jan 05, 2013
Posts: 12
posted
0
Ulf Dittmer wrote:Be aware that that code only works for XLS files, not XLSX files. If you want something that works for both files, you should use the org.apache.poi.ss.... packages instead of the org.apachepoi.hssf... packages; the code shouldn't be hard to refactor.
Oh okk. I didnt test it with a XLSX file. I shall refactor the code .