cancel
Showing results for 
Search instead for 
Did you mean: 

How to Generate PDF at runtime and open it into a new external window

tony_morellet
Participant
0 Kudos

Hi all,

I would like to generate a PDF at runtime into a new non modal external window.

This PDF is stored into a view and bind to my context.

Best regards,

Tony

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos
tony_morellet
Participant
0 Kudos

Hi all,

I have another problem.

When I click my button, my pdf seems empty. I have to click a second time to see him filled.

How I can simulate the click on the button in the wdDoInit ?

Regards

Tony

tony_morellet
Participant
0 Kudos

Hi All,

Anyone can help me to simulate the "buttton click" in the wdDoInit ?

best regards

Tony

Former Member
0 Kudos

Hi Tony,

What do u exactly mean by generating the PDF at runtime? U have to design the pdf & put that in a view. put that view in a window & use it. In case u don't want to design the PDF in webdynpro, then u can use smartform developed in ABAP . Use that as the resource for generating the PDF in webdynpro.

For any further clarification, please do revert back.

regards

Sumit

Former Member
0 Kudos

Hi,

Insert InteractiveForm into view's layout. Create attribute value in Context with type binary.

Assign PDF value to attribute value and bind the InteractiveForm's pdfSource.

byte[] pdfbyte = wdContext.currentNewOutputElement().getPdf();

final IWDCachedWebResource resource = WDWebResource.getWebResource(pdfbyte, WDWebResourceType.PDF);

resource.setResourceName("TestPDF.pdf");

//pop up

String url = resource.getAbsoluteURL();

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"value");

window.show();

Regards,

Eric

tony_morellet
Participant
0 Kudos

Hi Eric,

the problem is that the InteractiveForm's pdfSource is empty when we get it from the context, the problem is to force the generation of the pdf before using your code.

regards,

Tony.

Former Member
nikhil_bose
Active Contributor
0 Kudos

1) Put an Interactiveform UI element.

2) you will get URL of the file form Resource

3) create window using URL

refer this [blog|/people/amit.rai4/blog/2008/02/01/demystifying-attachments-with-sap-interactive-forms]

good luck

nikhil