on 02-28-2011 11:11 AM
Hello,
I need to create a application in Web dynpro Java with following functionality.
There will be a drop down button which will have options for type of letter to be displayed.
Once selected a value from drop down, user will click a submit button.
Now, a RFC will be called which will fetch data from R/3 system and that output data will be used to create this form.
User can save this file in his local desktop.
Now this file would be a pdf file.
My question is, how can I create this popup pdf file in web dynpro for java.
Hi
Use the following code to generate pdf from popup.
try
{
if (window != null)
{
window.destroyInstance();
}
IWDResource resource= wdContext.currentPdfDataElement().getO_Inv_Bin();
window= wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()), "Browser-description");
window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
window.removeWindowFeature(WDWindowFeature.MENU_BAR);
window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
window.setWindowSize(780, 430);
window.setWindowPosition(20, 140);
window.show();
}
catch (RuntimeException e)
{
// TODO Auto-generated catch block
logger.errorT("Error in method getPrintPDFService of " + this.getClass().getName());
logger.errorT("================Error====================\n" + e.toString());
e.printStackTrace();
}
Only point to remember is wdContext.currentPdfDataElement().getO_Inv_Bin(); is a content attribute of type binary which contain the binary data coming form RFC (backend).
BR
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thankyou Satish,
I need to generate this pdf file as a popup.
Their is no such requirement that PDF is to be triggered from some popup window.
To be very simple I dont need a popup window.
The home page of my application will have to button called "Generate PDF".
When user clicks on this button, a pdf file will be opened.
Saurabh, I understood what you want.
Since you want to use WD API only , so given solution was simplest one, that it will open a window from there you can save or print PDF data its like a external popup which contains the PDF. alternatively you can use the ADS to generate PDF doc on selection of any event inside WD app only.
BR
Satish Kumar
Hello Saurabh,
IWDResource resource = WDResourceFactory.createCachedResource(new ByteArrayInputStream(wdContext.currentRFCOutputElement().getXString()),"PDF",WDWebResourceType.PDF,true);
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.toString(),"PdfWindow");
window.show();
Use the above code to open.
Regards
Nizamudeen SM
Hi Saurabh,
Creating a pdf in Web dynpro Java, you can create word, pdf , etc
According to your requirement , you will input x, y and you will bring .... a,b,c,d from backend, but how you will display in
hte pdf? if wil be in line by line fashion or spacing. That is you wont have control of designing of pdf.
So, try to think of this way if it suits.
Web dynpro java, function module , smartform.
From webdynpor java give input , a, b...... through Function module fetch the data from r3 ... pass those to smartform,,,,
any way you design the output in the pdf....send back to ....Webdynpor java appliction,,, (that smartform is converted into pdf) .
Now there is a save button or print button in pdf,,, so save or print...according to your need.
Regards,
Srinivas
Edited by: srinivasa rao on Feb 28, 2011 3:07 PM
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.