on 01-01-2009 3:34 AM
Hi,
1. I have created one web dynpro application, in which i am accessing rfc function.
2. Rfc function's output is XString type (Smart form).
3. In web dynpro i am using the following code to display the same.
byte[] text = null;
text = wdContext.currentOutputElement().getBin_File();
wdContext.currentContextElement().setCtx_va_att(convertXStringToUrl(text));
public static String convertXStringToUrl(byte[] docContent)
{
String url = "";
WDWebResourceType resourceType = WDWebResourceType.PDF;
IWDWebResource webResource = WDWebResource.getWebResource(docContent,resourceType);
try {
url = webResource.getURL();
} catch (WDURLException e) {
// TODO Auto-generated catch block
url = e.getMessage();
return url;
}
return url;
}
4.I am setting this url to Source attribute of iFrame.
5. But in the output, it displays only the empty iFrame component.
6. I am using ep6 & netweaver ver 7.0.09
7. Also tried using WebCacheResource. It opens the Acrobat reader but displays error File does not start with '%PDF'.
7. What could be the error?
Thanks in advance,
Nilesh
Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nilesh,
Please check the Acrobat Reader is properly installed and its version and try the following code,
byte[] pdfContent = wdContext.currentXtstingElement().getE_Xstring();
String pdfFileName = "Test";
WDDeployableObjectPart objpart=wdThis.wdGetAPI().getComponent().getDeployableObjectPart();
IWDCachedWebResource pdfResource= WDWebResource.getPublicCachedWebResource(pdfContent,WDWebResourceType.PDF,WDScopeType.APPLICATION_SCOPE,objpart,"Page1");
try {
wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();
}
catch (WDURLException e)
{ wdComponentAPI.getMessageManager().reportException(e.getMessage(),false); }
Regards,
Suresh T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nilesh,
You can use this code:
public static String convertXStringToUrl()
{
String url = "";
IWDCachedWebResource l_file = WDWebResource.getWebResource(wdContext.currentOutputElement().getBin_File(),WDWebResourceType.PDF);
try {
url = l_file.getAbsoluteURL()
} catch (WDURLException e) {
// TODO Auto-generated catch block
url = e.getMessage();
return url;
}
return url;
}
Please Note: The important change made is use of IWDCachedWebResource and the URL has to be absoluteURL.
This should definetely solve your problem as i have gone through this once and followed this approach.
-Kunal Kotak
Edited by: kunal kotak on Jan 2, 2009 10:30 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.