|
Blogs
We have already developed the code for generating PDF report; please refer to Part-II for more information. Here we will only discuss about integrating it into WebDynpro application. We will create WebDynpro application, which will take name as input and generate PDF report accordingly.
You need to copy HelloReport.java and HelloReport.jrxml, to respective folders as shown in the Figure 1, from the project created as part of Part-II of this blog series. If you haven’t read Part-II please read it before going further. Also if you don’t find folders as shown in the figure create them accordingly. Similarly you should also copy your JasperReport jar files to lib folder. Your WebDynpro application should contain a view as show in the Figure 1 above. Create an input field and its text property should be bind to a context value attribute “name” of type string. Similarly create a button and bind its onAction event to GetReport action. If you go to Implementation tab, you will see a method created onActionGetReport, this method will be the center of our development. Rest of the form elements are just decoration. Code to be placed in your onActionGetReport method is: public void onActionGetReport(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
Jawed Ali is a Java & NetWeaver Consultant for SIEMENS, Pakistan. He has been working on Java, J2EE and Web technologies for past seven years. Add to: del.icio.us | Digg | Reddit
| |||||||||||||||||||||