cancel
Showing results for 
Search instead for 
Did you mean: 

Export to Excel

Former Member
0 Kudos

hi experts i have doubt in export to excel

i had aexternal jar file :jxl.jar in to my component and i have created a button and under taht button i ahve return the code

public void onActionExportToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionExportToExcel(ServerEvent)

try

{

Workbook wb=Workbook.getWorkbook(new File(path));

Sheet sh = wb.getSheet(0);

int columns = sh.getColumns();

int rows = sh.getRows();

int i=0;

for(int j=1;j<=rows;j++)

{

//Bapi_Salesorder_Getlist_Input ele=new Bapi_Salesorder_Getlist_Input();

ele=wdContext.nodeBapi_Salesorder_Getlist_Input().currentBapi_Salesorder_Getlist_InputElement();

Cell c1 = sh.getCell(i,j);

ele.setCustomer_Number(c1.getContents());

Cell c2 = sh.getCell(i+1,j);

ele.setPurchase_Order_Number(c2.getContents());

Cell c3 = sh.getCell(i+2,j);

ele.setSales_Organization(c3.getContents());

//Cell c4 = sh.getCell(i+3,j);

//Cell c5 = sh.getCell(i+4,j);

//ele.setMaterial(c5.getContents());

wdContext.nodeSales_Orders().addElement(ele);

}

}

catch(Exception ex)

{

wdComponentAPI.getMessageManager().reportSuccess(ex.toString());

}

//@@end

}

for me it showing error java.lang.NoClassDefFoundError: jxl/Workbook

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185086
Active Contributor
0 Kudos

Hello

Please have a look to this thread : [MS Office Export/Import to Excel |;

BR

Satish Kumar

p330068
Active Contributor
0 Kudos

Hi Pradeep,

After putting jxl.jar file in the lib folder of you webdynpro project. Use Repair and Rebuild your project...

if still not resolved use Ctrl + Shift + O for organizing imports. then deploy to server.

I think it will resolve your issue.

Thanks

Arun

former_member182374
Active Contributor
0 Kudos

Hi,

Assuming your are not using DC WD Project a quick and dirty solution would be to copy the jxl.jar file to the lib folder of your WD project and deploy the project to the server.

Regards,

Omri