on 01-28-2010 5:56 AM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.