on 06-15-2005 8:01 AM
hi
How to upload excel file in webdynpro.
What are the steps needed to be done?
regards
Hi Kamlesh,
you can use the upload UI Element to upload any kind of files from the client system to the server.You need to create a value node with 2 attributes of type binary and string respectively and map it accordingly to the "data" and "filename" properties of the UI Element.make the instance of the value node and create a simple type of that attribute.
Iprivateview.IUpload upload = wdContext.createUploadElement();
wdContext.nodeUpload().invalidate();
wdContext.nodeUpload().bind(upload);
IWDAttributeInfo info = wdContext.nodeUpload().getNodeInfo().getAttribute("data");
IWDModifiableBinaryType binary = (IWDModifiableBinaryType)info.getModifiableSimpleType();
binary.setFileName(upload.getName());
hope this will help.
Regards,
Shyam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Kamlesh,
u can upload files to the server using upload UIE. for that u need to create a value node with 2 attributes - one of type binary and other of type string (one to store data and other for the file name).
write this sample code in init()
Iprivateview.IUpload upload = wdContext.createUploadElement();
wdContext.nodeUpload().invalidate();
wdContext.nodeUpload().bind(upload);
IWDAttributeInfo info = wdContext.nodeUpload().getNodeInfo().getAttribute("data");
IWDModifiableBinaryType binary = (IWDModifiableBinaryType)info.getModifiableSimpleType();
binary.setFileName(upload.getName());
write this in onAction of the button which uploads the file.
File file = new File(upload.getName());
FileOutputStream out = new FileOutputStream(file);
out.write(upload.getData());
hope this might help u.
regards,
Piyush.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.