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