on 07-05-2010 1:13 PM
Hi all,
I have a requirement where i need to uplaod an excel file from the users local system to Server.
But before saving i want to do certain validation on the Excel file which the user is trying to upload.
1. Is the Excel file in the same format as expected . ie the coloumn order , all the required coloumns etc
2. is there a possibility for me to check if certain coloumn values are mandatory .
Can you please guide me providing some docs on coloumn validation of the Excel.
Thanks,
Swetha
Hi Swetha,
First you have create one Value Node that node having 5 attributes. For Example you excel having 5 Columns data So you can create 5 attributes under value Node.
Can u see below Code.
IPrivateASNFileUplaodView.IASNDetails_PopUpNode node = wdContext.nodeASNDetails_PopUp();
IPrivateASNFileUplaodView.IASNDetails_PopUpElement ele;
if(node.size() > 0)
{
for(int i =0;i <node.size();i++)
{
ele = node.getASNDetails_PopUpElementAt(i);
if(ele.getOpn_Quantity() != null )
{
flag = true; //wdComponentAPI.getMessageManager().reportException(ele.getQuantity()+"val",true);
}
else
{
flag = false;//wdComponentAPI.getMessageManager().reportException("else-c1",true);
break;
}
if(ele.getPo_Number() != null && ele.getPo_Number().length() != 0 )
{
flag = true; //wdComponentAPI.getMessageManager().reportException(ele.getPlant()+"val",true);
}
else
{
//wdComponentAPI.getMessageManager().reportException("else-c2",true);
flag = false;
break;
}
if(ele.getPo_Item() != null && ele.getPo_Item().length() != 0 )
{
flag = true; //wdComponentAPI.getMessageManager().reportException(ele.getMaterialNumber()+"val",true);
}
else
{
flag = false;//wdComponentAPI.getMessageManager().reportException("else-c3",true);
break;
}
}
}
if(flag)
{
wdThis.wdGetCO_ASNFileUplaodController().executeYmm_Sc_File_Upload_02_Input();
wdComponentAPI.getMessageManager().reportSuccess("File Upload Sucessfully");
}
else
{
wdComponentAPI.getMessageManager().raiseException("Please fill in all the values in Excel sheet and Upload Again.",true);
}
By using this code Validating the Data in Excel before uploading .
Hope this is help full for you Swetha,
Regards
Vijay Kalluri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.