cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting table data to MS-Excel Sheet(enhanced Web Dynpro Binary Cache)

Former Member
0 Kudos

Hi experts,

I am trying to implement the functionality of downloading the contents of a webdynpro screen to excel sheet. In order to implement the functionality of excel download i used the following blog.

[/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache ]

In this blog they have used javaexcel api to implement the excel functionality. I face some problems

while implementing it.

i) The use of "Label label = new Label(0, 2, "A label record");

sheet.addCell(label); " is not supported. It says that a constructor for label with

(int, int, str) parameter is not available.

ii) Then i implemented it with "Label label = new Label("A label record"); " Then i deployed it. I got a runtime exception saying that " java.lang.ClassNotFoundException: jxl.format.CellFormat ".

This cellFormat is an interface available in the jar. I am using jexcelapi_2_6_9_1.4 version. Do i have to

download some other versions.

Please help. Thanks in advance.

Regards

Ramanan

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi

use this way.....and did you add the xlf.jar file...

jxl.write.Label label = new jxl.write.Label(0, 0, "Id", redFormat);

sheet.addCell(label);

label = new jxl.write.Label(1,0,"No",redFormat);

sheet.addCell(label);

label = new jxl.write.Label(2,0,"Arrival city",redFormat);

sheet.addCell(label);

thanks

Former Member
0 Kudos

Hi anup,

Thanks for the reply.. I came to know about the usage of label yesterday.. Thanks again.. But i have a problem now.. This code is working fine in java but when i use in netweaver development studio i get an error saying class not found. I have added the jar file jxl.jar to the library. Which jar file are you asking about by saying xlf.jar?

Looking forward to your reply...

Thanks & Regards

Ramanan

former_member192434
Active Contributor
0 Kudos

Hi

you need to add the jxl-2.6.3.jar or above version inside your lib folder of your application and java build path....rbuild your applicaiton and restart your NWDS...deploye application it should work.

this class not found exception is comeing becouse the required jar(which mention above) file is not reaching to the server...

thanks

AB

Former Member
0 Kudos

Hi anup,

Thanks for the reply... I have already added the jxl.jar file into the library of my development component. I have build it once and then restarted. While deploying it gives that error saying class not found.

Looking forward to your reply..

Thanks

Ramanan

former_member192434
Active Contributor
0 Kudos

Hi

the require jar file is not reaching to the server.........Generally when you put jar file into lib folder it reaches to the server with your application..........But in your case not reaching to server... you can deploy that jar file to server manually.......with the help your BASIS team

Thanks

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Please check the following steps while creating External Library DC:

1) creating an Extneral library DC

2) import the JARs to the libraries folder of the External Library DC project

3) Right-click on each of the JARs imported to the project and add them to the public part.

This DC is now ready to be used as a build-time reference that will allow CBS to build the "main" Web Dynpro application that will use the external libraries. Next, we have to create a new Web Dynpro DC to hold the class files here are the steps:

1) Create a new Web Dynpro DC

2) Create a new public part, selecting the "Can be packaged into other build results" option

3) Rename the JARs as Zip files and extrct the full content (folders and class files) to your root folder

4) Import the folders and files to the src/packages folder

5) Expand the public part node that was created and select the "Entities" node, right-click it and choose Edit

6) In the Entity Type list select the "Folder" option then in the selected entities tree pick each of the folders that you imported in step 5 (above)

7) Now do a DC build and a DC deploy of the project

Then check-in, activate, and release any activities you have associated with creating these two projects. In the DC perspective, refresh the Active DCs and Inactive DCs to ensure that both new DCs appear in the Active list. Now we have to setup the references to these DCs in our main Web Dynpro application. To do this, follow these steps:

1) Open the Web Dynpro perspective and right click the Used DCs node then choose "Add Used DC.."

2) Pick the public part of the External Library DC that we created (first) and set it to have a Build Time dependency

3) Again, right click the Used DCs node and choose "Add Used DC.." then choose the public part of the Web Dynpro DC that we created and give it a Run Time dependecy (weak) and click finish.

4) Now, due to what I think is a bug. You must right click on the Web Dynpro "used DC" that you just added in the previous step, and set the run time dependency again (it seems to revert to the default values for some reason)

5) Now do a DC build and a DC deploy on the "main" web dynpro application.

6) Check-in, activate, and release any activities associated with adding these references and then others on your team may use the classes in the external libraries within the Web Dynpro project.

Regards.

Rajat

Former Member
0 Kudos

hi rajat,

Thanks for your reply...

I tried the solution suggested by you. I get the same error.

You have asked to make use of the external library in a webdynpro dc and then add this used dc to the required development component. I got a material in which they have suggested the use of j2ee server component library intstead of webdynpro dc. In this j2ee server component library they have added the external library and then made use of this j2ee library in the development component. I am using nwds 7.1. J2ee server component library is available in 7.0 but am not able to find out such an option in nwds 7.1. Any idea about this?

Looking forward to your reply....

Regards

Ramanan

Former Member
0 Kudos

Hi all,

The problem is solved... We need to use a j2ee enterprise application. The external library should be added as dependency to this enterprise application and then this enterprise application should be added to our development component. We need to have two public parts in our external library (compilation and assembly).

Thanks for the help....

Regards

Ramanan

Former Member
0 Kudos

Hi,

It should have solved the problem. Now I do not have any idea why it is giving this error.

Can only say just check the steps for creation of external library dc again: you are not missing anything?

Regards.

Rajat

Former Member
0 Kudos

Hi,

In the DC, expand the DC metadata node>expand the Used DC node> Right Click on the DC that u have added here and Select Edit Properties.

Now check whether all the dependencies type checkboxes are checked or not. Check them and click on Finish.

That should solve your problem.

Regards.

Rajat

Former Member
0 Kudos

Hi rajat,

Thanks for the immediate response... I have added the external library in the dependencies (used dc's) of my development component. I have selected design, build and deploy time.

While deploying i get the same error. Anything else needs to be done?

Looking forward to your reply...

Thanks & Regards

Ramanan

Former Member
0 Kudos

Hi,

To add a jar into your dc you can not simply put it into the build path or add it to the library as you do in case of WD projects. But to include a jar in a DC you need to create an External Library DC.

Check the following link how to create an external library dc:

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

Regards.

Rajat

Former Member
0 Kudos

Hi Rajat,

Thanks for the useful reply... I have created an external library dc and then added public parts of compilation and assembly. Then i build that dc.

Then in the development component which i hav developed i right clicked then on the properties->java buid path->add jar->clicked on the external library created->selected the jar.

I built this component.

Then i tried deploying my component. Even then i got the error saying class not found.

Anything else needs to be done?

Looking forward to ur reply...

Thanks & regards

Ramanan

Former Member
0 Kudos