Showing results for 
Search instead for 
Did you mean: 

Excel Upload / Download.

Former Member
0 Kudos


I want to upload and download excel file using web dynpro for java. So, can any one provide me a tutorial which would guide me do the same.

Thanks & Regards,


Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Rahul

Check out this for using file upload & download UI element in 2004s



Former Member
0 Kudos

chk it



Upload Excel file.

1)Add jxl jar folder in the lib folder of ur project.

2)Go to properties of ur project and add jar to ur project.

3)Using the File upload ui ,browse and upload the file.

4)Write the read file in to ur server location using fileoutput stream.

5)then using code u can read the excelfile from the server location itself.

Here is the code:

IWDAttributeInfo attInfo =wdContext.getNodeInfo().getAttribute("upload");

/** get the name of excel file and storing it in the server with the same name and extention****/


fileuploaded = binaryType.getFileName();

byte b[] = wdContext.currentContextElement().getUpload();

File filename =new File("

<Server name>
<folde name>
" + fileuploaded);

try {

FileOutputStream out = new FileOutputStream(filename);



} catch (FileNotFoundException e) {

// TODO Auto-generated catch block


} catch (IOException e) {

// TODO Auto-generated catch block



/**Readind from the server**/

int iRows = 0;

try { Workbook wb = null;

Sheet sheet = null;

wb = Workbook.getWorkbook(filename);

sheet = wb.getSheet(0);

int iColumns = sheet.getColumns();

iRows = sheet.getRows();

int i = 0;

//get Cell contents by (COLUMN, ROW);

for (int r = 0; r < iRows; r++) {

for (int c = 0; c < iColumns; c++) {

Cell cell = sheet.getCell(c, r);

characterarray<i> = cell.getContents();

//wdComponentAPI.getMessageManager().reportSuccess("Row"r characterarray<i>);





Declare Globally

//@@begin others

String fileuploaded;

IWDModifiableBinaryType binaryType;

String characterarray[] = new String[1000];


Former Member
0 Kudos

hi rahul

use this one