on 02-22-2008 8:24 PM
Hi..
I am trying to display the smartform . I tried the following code and it gives me null pointer exception at "wdContext.currentInternalElement().setUrl(
convertXStringToUrl(....."
Control going to back end.. able to debug it.. .bin file is also getting generated.
//@@begin wdDoInit()
Z_Test_Smartform_Input input = new Z_Test_Smartform_Input();
wdContext.nodeZ_Test_Smartform_Input().bind(input);
try {
wdContext
.currentZ_Test_Smartform_InputElement()
.modelObject()
.execute();
} catch (WDDynamicRFCExecuteException e) {
e.printStackTrace();
}
wdContext.currentInternalElement().setUrl(
convertXStringToUrl(
wdContext.currentOutputElement().getBin_File()));
//@@end
//@@begin others
public String convertXStringToUrl(byte[] doc_content) {
String url = "";
WDWebResourceType webResType = WDWebResourceType.PDF;
IWDWebResource webResource =
WDWebResource.getWebResource(doc_content, webResType);
try {
url = webResource.getURL();
} catch (WDURLException e) {
e.printStackTrace();
}
return url;
Hi ,
Insert UI of element IFrame and bind the Source property to pdfUrl value attribute of type string.
In Webdynpro view after Executing the RFC
byte[] pdfContent =
wdContext.current<output_node>.get<BinaryExport>();
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);
try
{
/* PdfUrl is of type String */ wdContext.currentContextElement.setPdfUrl(pdfResource.getURL());
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
}
Thanks,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The out put of the RFC is a bytestream,ie a smart form converted into bytestream.
byte[] pdfContent=wdContext.nodeOutput().currentOutputElement().getTestform();//This line will convert the output of the RFC into a byte array,
IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF); //this line will convert that byte array into pdf form
try{
wdContext.currentContextElement().setPdfurl(pdfResource.getURL());//Pdf ur l is a value attribute in the context of type string . bind this string attribute to Iframe or adobe interactive form.
}catch (Exception e) {
wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
}
I hope this will work it is working fine in my application
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Warm regards
Shanto Aloor
Edited by: Armin Reichert on Apr 26, 2008 7:07 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
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.