Skip to Content
0
Former Member
May 11, 2010 at 11:20 AM

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

30 Views

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