cancel
Showing results for 
Search instead for 
Did you mean: 

HSSFWorkbook

Former Member
0 Kudos

Hi,

I am using NWDS 7.0. I always get error in this line of code

HSSFWorkbook wb=new HSSFWorkbook();

Whenever I have to read/write an excel file I have to use this particular line. But I always get error in this line and i am not able to move further.

I have added poi 3.2 jar to java build path as external jar. I have also copied and pasted it in lib folder in navigator tab of my dc. But still i get the error.

Do any of you have idea on this?

Regards

Janani Anandan

Accepted Solutions (1)

Accepted Solutions (1)

amolgupta
Active Contributor
0 Kudos

Hi Janani,

you are using poi 3.2 jar which is an external jar. The Jar and java API inside the jar is made available to you in the designtime in the NWDS but the same are not available to your application as the jar did not go to the SERVER, it was sitting on your desktop filesystem all the time.

So even though it got the jar in the designtime, it did not get the jar in the runtime.

You need to make a lib DC and reference that lib DC from your WebDynpro Project to make that external jar available to your application at run time.

The following should help you -

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b71...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/006a6229-b1ed-2e10-0c8c-cc5673cf2...

some more info

http://help.sap.com/saphelp_nw70/helpdata/en/46/3ce3e4df201d63e10000000a11466f/content.htm

http://help.sap.com/saphelp_nw70/helpdata/en/5a/2e2f4234135433e10000000a155106/content.htm

Thanks and Regards,

-Amol Gupta

Former Member
0 Kudos

Hi Amol,

You are right. I do not have external jar in server. it is available only in design time. Thank you for your suggestion.

Regards

Janani Anandan

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

search in SCN regarding how to use external lib

vijay_kumar49
Active Contributor
0 Kudos

Janani,

Please look at this code:

IWDResource resource = // Your Resource

InputStream inputStream = resource.read(true);

HSSFWorkbook workBook = new HSSFWorkbook(inputStream);

Hope this helps!!

Regards

Vijay Kumar Kalluri