In this blog, I’m going to discuss tips and tricks to consider when printing to PDF from the Web Application Designer in SAP NetWeaver 2004s BI.
How it works?
The most important thing to consider, is which objects are supported when printing to PDF. This is listed in the online help here: http://help.sap.com/saphelp_nw2004s/helpdata/en/43/68ce8391886e47e10000000a422035/frameset.htm. Therefore, these are the only web items you can print to pdf. When printing to PDF, you have 2 options:
- 1. Print all web items in web template – In this case, any supported web item you choose will be printed in the order in which it appears in the web application.
- 2. Bind printing to individual supported web items – In this option, you can display lots of web items on your web application, but only print a few when exporting to PDF.
The most important thing to note is when printing to PDF, the entire web application as displayed on the screen isn’t printed to PDF. The web items used are sent sequentially, in the order they appear in the web application, to be printed in PDF. Therefore, the printing prints each web items sequentially and doesn’t retain layout of these web items with respect to each other. Therefore, if two items are “side-by-side” on the web application, they won’t be printed that way. The first one will be printed to PDF and the second one will be sent after it and appear underneath in on the PDF. The only way to retain format is to use the “Report” web item. This web item will print the format as it appears.
Updating Headers and Footers
As shown in the link above from the online help, the headers and footers support date, time, page numbers, and free text. If you want to add other parameters to the header or footer, currently, as of SPS9, this is not available natively. Currently, there are plans in SPS11 to allow including an image in the header of web applications via the print dialog as per the GA Limitations listed here: https://websmp208.sap-ag.de/~sapdownload/011000358700003437292006E/FunctEnhancSchedNW2004sB.ppt.
To embed images in your web application, you can use img tags to embed images within the body of the web application. This cannot be included in the header when printing to PDF as listed in the limitation above. To do this currently, any image in the body will be printed when printing to PDF. To embed an image from the MIME repository, you can use the following code:
This image will be printed in the order in which it appears within the web application. Again, this does not retain the layout positioning of where the image is located in the web application. To print an image to PDF with regard to keeping layout, you must embed it in the report web item and use this report item within your web application.
Working with objects in the body
As mentioned in the online help, the export to PDF supports the Information Field web item. You can use this to display filter values, variable values, or generic text elements. If you use this in your web template, you can print out this information within your PDF export. If you want some of these properties to print at the top of your application, and some at the bottom, you will need to embed this twice and bind the individual parameters you want in each web item.
The other option is to use the Text web item. If you this at the top of the web application, this information will show at the top of the PDF export. The difference with using these parameters at the top of the web application and using the header is that the header repeats on each page whereas these parameters will only show on page 1. Using this text web item, you can hardcode any header parameter you need. To dynamically populate this with parameters such as the query name, filter values, variable values, or even results cells, you can use XPATH statements. See this blog on using XPATH statements: Using XPATH statements within SAP NetWeaver 2004s BEx Web Application Designer – Part 1.
The most important thing to note is that layout must be controlled within the report item. If you want to embed a formatted report and chart side by side, both must be embedded in the Report Item. Otherwise, these are serialized within the web application and they will be printed vertically, not horizontally.
I’ve tested these scenarios on SPS9 with FEP902. Hope this helps you with your printing needs!