cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Copying of Data From Excel file to Web Dynpro Java Table

Former Member
0 Kudos

Hi

Can any body give Suggestions that is how to copy or import Row and Column Values in the Excel file to the Java Web Dynpro Table

Regards

Chandran S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

First u should include jxl.jar API in ur classpath.

ind a Resource variable to FileUpload UI. Then from the Fileupload UI, u can get the Sheet variable as

InputStream fis=wdContext.currentFileUploadElement().getResource().read(true);

Workbook wb=Workbook.getWorkbook(fis);

Sheet sh=wb.getSheet(0);

This can be easily read to a table by

for(int i=14;i<34;i++)

{

String bId=sh.getCell(2,i).getContents();

String cId=sh.getCell(3,i).getContents();

String subj=sh.getCell(4,i).getContents();

IPrivate<View>.I<Table>Element el=wdContext.node<Table>().create<Table>Element();

wdContext.node<Table>().addElement(el);

el.setBID(bid);

el.setCID(cid);

el.setSUB(subj);

}

This example reads the excel from row 13 to 32 and column 3 to 5 and uploaded to a table

Regards

Fahad Hamsa

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chandran,

Please refer to the following blog for <b>Downloading jxlAPI Jar file</b> and the complete procedure:

<b>Subramanian's Blog</b> /people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache

Hope it helps.

Regards,

Alka.