Tips & Tricks when Printing to PDF in SAP NetWeaver 2004s BI
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!
I spent some time with this. Basically, these are my findings:
1. You can specify a print template when exporting. This print template dictates the web items to send out for printing. Therefore, it would help you if you wanted to display a table, but when you print, print both text elements and table.
2. The Print Template does not dictate portal themes. Also, your Portal themes aren't used for printing. When printing to PDF, there are only 2 themes available: SAP Standard, and Black and White. The SAP Standard is the color version, and the Black and White is just black and white.
3. I did test using inline CSS and this works to overwrite the portal theme for a particular web template, but this inline CSS isn't used for printing as the theme from printing overwrites this inlines CSS.
Therefore, when printing to PDF, the themes only allow you to say color or black and white. It doesn't allow you to specify your own corporate colors.
These are my findings on this on SPS9 (BIWEBAPP patch 6 with FEP903.
just wondering whether there has been any development on this? i.e. whether it IS now possible to print to customer-defined templates. We are on SP10.
At the moment it is not possible to change the default value for theme like all the other settings (Footer, paper etc.)
are the two styles (color and B&W) used for printing PDF the standard portal CSS files?
Would it be helpful to modify the CSS file to change the layout of the PDF?
Or is the print layout fixed elsewhere?
Thanks for your support,
In the report designer you only have the possibility to include dataproviders serially (as sections). In the trainings we even stress (according to the training slides), that if you want two tables (with report designer layout) side by side, you have to create two reports by the report designer and then include two separate report items side by side in your web template (via table or container grid).
So there is probably a mismatch in our understanding, because afterwards, these two report items are again printed serially ?!? Please clarify. Up to now, I do not see any possibility to realize structured printing - which of course is bad.
Also, using the Container Layout web item for PDF printing for structured formatting with printing is being added with SPS11 (also in the release limitations).
i have used a container layout with 6 reports. Image I have a web applicion like a dashboard: 2 reports side by side * 3 times.
when the report is exported to pdf, all reports all exported in sequence. We are in SP09, waiting for released SP10. any advice?
I don/t want to print serially. I want to print the 2 reports side by side. And what do you mean : use a local PDF printer?
I read the last version of release limitation (last update 24/11). There is no info about this kind of pdf export. Also, the same problem exists when you export to xl.
comparing your answer to my question below: Does this mean, that there be no possibility to print web items side by side also in in the future? As a consequence, you will really only be able to print serially?
I have a specific report with 2 formatted reports side by side.
How can I print these as I saw the web application? I tried through report designer,
But you cannot declare 2 report sections side by side but only sequently.
first of all happy new year.
I tried the tip you proposed, but i'm afraid that it didn't work.
You cannot add details values from the second dataprovider to the first section with the first dataprovider.
Both of my dataproviders are not statics (I mean with 2 structures - rows/columns).
Also, I need to include a chart and as I understand this is not supported until SP11.
I understand that there is no solution from SAP in order to print what you see from portal.
It has been almost 2 years... We delivered dashboard reporting for our customers and a major issue right now is "side by side" PDF printing. We are on SP13 and will be on SP14 very soon. We could not find any information on the release notes if the functionality of side by side printing will be available or not. If not, can you please recomend anything? Any workaround? This functionality is so important to the customers that we are kind of desperate in finding the solution... Any 3d party tool may be that you know of? Any help would be greatly appreaciated. Thanks!
I am on support pack 10 for both front and back end.
Our web template includes the following images.
1. Company Logo.
2. Images with commands attached; EG: Download to Excel.
When I export (print) to PDF both the company log as well as the images (icons) for the commands are shown in the PDF document. Is it possible to exclude the images that are simply to execute commands in the web report? These images look out of place in the PDF document?
I look forward to your response.
Now, there are two options
1) Pass the value of the text/input item to the Report Designer and link it to the header
2) Bind the text/input item and the report item when we use the Export command.
We were unable / have no idea on how to do it via option 1.
In option 2, as you have mentioned, the text/input item gets printed only on the first page.
Now coming to my query, in your second last paragraph you write about using a Text Item as a Header in the PDF. We could not find this option in the Front End and request you to explain more on this.
PS: We are on BW SP12 / FrontEnd SP13.
For option 2, I mentioned the limitation of using the text web item as it won't show up on every page. Using xpath, you may be able to bind this to a parameter. I'll take a look at this and try to mock up an example and write a blog in the future on this.
I think for option 1 to work we would have to create a dummy characteristic which probably isnt a neat solution.
For option 2 - I was refering to your phrase - "Using this text web item, you can hardcode any header parameter you need. ". Looks like I misinterpreted this.
Look forward to your future blogs.
i hope you do not mind me asking this long after publishing. We want to print web items that are included in TEMPLATE_INCLUDE items.
But when we create a new web template and try to print (or export to excel) this, the items from the TEMPLATE_INCLUDE_ITEM are not included.
Can you confirm or counter this?
If so, this is very unfortunate because the TEMPLATE_INCLUDE is a strong feature to use as a meta template. But a little useless when it cannot be printed.
The list of supported web items for printing is here:
I'd log a development request for this functionality, as I think it would be useful to get added.
We are publishing the BEx queries in portals using 0ANALYSIS_PATTERN as the default web template. When printing into PDF we are getting the report filter and variable information along with the desired PDF output. While going through your blog i came to know that there is a way to supress the undesired web items in printing by using option 2 as discussed by you.
Could you please elaborate the steps please for option 2 and how can i supress the report filter and variable information while printing into PDF format.
This is described in the online help over here:
Can we define our own PDF Print Themes. If so, how?
We are on SPS12.
Do you think this will be available quite soon?
We are migrating to 7.0 and this is definitively an issue.
We have to be able to apply a theme to the PDF print even by modifying the standard if needed...
Would it be possible to include "page break" in the PDF Printing functionality in NetWeaver 2004s?
I tried to modify the Standard Web Printing Template HTML coding to include the "page break", but I could not make it work.
Does SAP offer any standard functionality for inserting page break?
Many thanks in advance.
I'm really happy I get the link to this blog because we are facing the same problem.
Can you give me a hint how to fit the page to column width?
Can't find where to go to change what surely must be a setting as development and production are fine.
Ideas? Or where should I go. Thanks.
We are getting exactly the same error when trying to produce BI reports from within Netweaver portal. Error (401) Unauthorized in Portal Java logs.
Would be grateful for your advice on whether you resolved this problem and how? Our ADS RFC from BI backend connects OK. HTTP services for fp & fpad are activated & OK.
is it possible now, in BI SPS17 natively or using a workaround to add a picture or another object (concerning a small crystal report (report designer) object) directly into a header of a PDF-document?
if yes how, if now, how to manage it or when this functionality will be available? (Prakash mentioned SPS11...)
Thanks for this informative Blog. I was successful in displaying my company Logo in the generated PDF by embedding it in a Report web item. But the problem is the logo appears only on the first page of the PDF. Is there any trick whereby I could display it as a header on all pages of the generated PDF. Pls help.