cancel
Showing results for 
Search instead for 
Did you mean: 

SmartForm output not getting displayed in WD.

Former Member
0 Kudos

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;

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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