on 05-11-2010 12:20 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.