cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out each Cell having Data or Not in Excel File by Using WDJ

Former Member
0 Kudos

Hi Friends,

I have one doubt on WDJ.

I have to Upload Excel File. Click on Upload Button in Excel file Data will move to One Bapi. This is I was done. But my Requirement is if any empty Cell in Excel That File not uploaded it display one error message Please upload Correct Excel File

How to find out each Cell having Data or Not in Excel File by Using WDJ. Please tell me.

By Using this Code I have Upload Excel File

InputStream text = null;

int temp = 0;

//wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");

try

{

File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());

FileOutputStream op = new FileOutputStream(file);

if (wdContext.currentContextElement().getResource()!= null)

{

text = wdContext.currentContextElement().getResource().read(false);

while((temp=text.read())!= -1)

{

op.write(temp);

}

}

op.flush();

op.close();

path = file.getAbsolutePath();

//wdComponentAPI.getMessageManager().reportSuccess("Path Name :::::"+path);

}

catch(Exception ex)

{

ex.printStackTrace();

}

But my Requirement is If excel having any Empty Cell that excel file not uploaded.How to do this...

Regards

Vijay Kalluri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi my friend

I would like to share you some APACHE APi´s that i use when i have to read excel files in Web Dynpro.

JAR = poi-3.2-FINAL-20081019.jar

Some Example:

POIFSFileSystem fs;

HSSFWorkbook wb;

HSSFSheet sheet;

String myMexican_ValueFromExcelis = "";

try {

fs = new POIFSFileSystem(new FileInputStream();

// and select the cell "y"

cell = row.getCell( 0 );

myMexican_ValueFromExcelis = cell.getCellValue();

}cach(Exception e){

}

REgargds

Answers (0)