on 04-06-2007 5:05 PM
Hi,
Can u tell me if we how can we retrive attachments from the interactive form of a web dynpro application at runtime?
I am able to attach documnets to PDF form programetically but unable to retrive it.
Even i am able to successfully save entire PDF document with these attachments on local machine but unable to retrive attachments from PDF document.
I have tried 3 methods provided by API to detach attachments but seems to be none of them or working.I have tried with SP9,SP10, and base relese of SP11.
Here is code snippet.Please do let me know any body has done any thing to retrive these attachments.
IWDPDFDocumentAccessibleContext acc =WDPDFDocumentFactory.getDocumentHandler().getDocumentAccessibleContext();
acc.setPDF(wdContext.currentContextElement().getPdfSource());
pdfDoc = (IWDPDFDocument) acc.execute();
IWDPDFDocumentAttachment[] attList = pdfDoc.getAllAttachments();
//IWDPDFDocumentAttachmentList li = pdfDoc.getAttachmentList();
messageMan.reportSuccess("Processing attachments " + attList.length);
Hello Sudheer,
One peice of code is missing in your implementation. It should go as follows:
IWDPDFDocumentAccessibleContext acc =WDPDFDocumentFactory.getDocumentHandler().getDocumentAccessibleContext();
acc.setPDF(wdContext.currentContextElement().getPdfSource());
<b>acc.getTaskSetter().addGetAllAttachmentsTask();</b>
pdfDoc = (IWDPDFDocument) acc.execute();
IWDPDFDocumentAttachment[] attList = pdfDoc.getAllAttachments();
//IWDPDFDocumentAttachmentList li = pdfDoc.getAttachmentList();
messageMan.reportSuccess("Processing attachments " + attList.length);
The code inbetween in the bold, indicates the web dynpro framework to get the attachments attached. Without this, Web Dynpro would have tried to get the attachments
on every roundtrip even when you do not want it.
Best Regards,
Krish
Message was edited by: Krish
Krishanu Biswas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have the same scenario as given above. I inserted the line
getTaskSetter().addGetAllAttachmentsTask();
, as you have mentioned. But again I am getting
NoSuchMethodFound
error, now in the newly inserted line
getTaskSetter().addGetAllAttachmentsTask();
.
Please, Can you give me a solution?
Thanks,
Prabhakar.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.