on 10-27-2008 4:11 PM
Hi,
I am generating a PDF form using interactiveform element and displaying in a separate view. Is it possible to download the same generated form instead of displaying in view?
Please sugest me on this.
Thanks,
Raz
Hi Raz,
Try this...
1. Create a context attribute(res) of type com.sap.ide.webdynpro.uielementdefinitions.Resource
2. Insert a file download ui control and bind the property resource to the above attribute
3. you must have defined a pdfSource of type byte[], using that populate the 'res' attribute
IWDResource res = WDResourceFactory.createResource(wdContext.currentContextElement().getPdfSource(),"",WDWebResourceType.PDF);
wdContext.currentContextElement().setRes(res);
-Aarthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use this following code in any button action, then you will be seen a popup window to download the pdf from resource path
Hope
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getUrl(WDFileDownloadBehaviour.ALLOW_SAVE.ordinal()),
resource.getResourceName());
window.show();
Hope you have pdf in IWDCachedwebResource
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aarthi,
Thanks for your patience. I am getting the fallowing runtime error when I am executing. I wrote the code in wdinit() specified by you.
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
at com.sap.tc.webdynpro.progmodel.mime.UploadResource.<init>(UploadResource.java:30)
at com.sap.tc.webdynpro.progmodel.mime.ResourceFactory.createResource(ResourceFactory.java:104)
at com.sap.tc.webdynpro.progmodel.api.WDResourceFactory.createResource(WDResourceFactory.java:58)
at com.greenheck.orderstatus.PDFView.wdDoInit(PDFView.java:130)
Thanks,
Raz
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.