Skip to Content
Introduction

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.

Printing Pictures

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.

Summary

I’ve tested these scenarios on SPS9 with FEP902. Hope this helps you with your printing needs!

To report this post you need to login first.

49 Comments

You must be Logged on to comment or reply to a post.

    1. Prakash Darji Post author
      Hey Michael,

      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.

      (0) 
      1. Patrick Byrd
        Hi Prakash.
        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.
        Thanks,
        Patrick
        (0) 
        1. Prakash Darji Post author
          You can print to custom defined print templates, but you will only have to portal themes available (color or black & white)….
          (0) 
          1. Steffen Borg Sørensen
            Is there a work around to have the black & white theme as default instead of the color theme in a print button ?

            At the moment it is not possible to change the default value for theme like all the other settings (Footer, paper etc.)

            /Steffen

            (0) 
              1. Thomas Trauth
                Hi Prakash,
                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,
                thomas

                (0) 
                1. Prakash Darji Post author
                  Hey Thomas,

                  As always, there are tricks to change some things under the hood, but core mods aren’t supported by SAP… If you’re interested in going down this route, you can use some html and javascript debuggers to track this stuff down.

                  Cheers,
                  Prakash

                  (0) 
  1. Ingo Peter
    I am not sure if that is right resp. I do not understand some things:

    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.

    Regards,
    Ingo

    (0) 
    1. Prakash Darji Post author
      Adding charts in the report designer is coming in a later support package as part of the release limitations.

      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).

      (0) 
  2. Emmanuel Kouvaritakis
    dear sir,
    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?

    Best regards
    Manos Kouvaritakis

    (0) 
    1. Prakash Darji Post author
      This is being added in SPS11, not SPS10. The only way to print this to PDF serially in SPS9 is to use a local PDF printer installed on the client PC.
      (0) 
        1. Prakash Darji Post author
          I understand. Printing side by side with the container layout web item is being added with SPS11 as I said. What I meant by installing locally is that you install a PDF Printer on the client PC.
          (0) 
          1. Emmanuel Kouvaritakis
            Dear Prakash,
            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.
            (0) 
            1. Prakash Darji Post author
              I stand corrected. I followed up with development and this is not being added with SPS11. Container Layout is not going to be supported for printing to PDF. I saw this discussed internally but the plan was not finalized. Sorry for the inconvenience.
              (0) 
              1. Ingo Peter
                Hi Prakash,

                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?

                Regards,
                Ingo

                (0) 
                  1. Mark vittel
                    Dear Sir,

                    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.

                    Best Regards
                    Manos Kouvaritakis

                    (0) 
                    1. Prakash Darji Post author
                      You can insert 2 dataproviders and insert new columns to the right of the first report section and then move the cells from the 2nd dataprovicder to the new columns on the right of the first report section. You can’t put the sections side by side directly.
                      (0) 
                      1. Mark vittel
                        Dear Prakash,
                        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.

                        Best Regards
                        Manos Kouvaritakis

                        (0) 
                              1. Valery Gallay
                                Hi Prakash,

                                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!
                                Val

                                (0) 
  3. Rico Portner
    I noticed that structured PDF-printing will be possible with SPS11 (we also want to print charts side by side).
    An additional request will be to process JavaScript in the broadcaster for detailed table design. Do you see any chance to have processed JavaScript broadcasting WebTemplates??
    (0) 
  4. Ian Carbonel
    Hi Prakash

    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.

    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.

    Regards

    Ian

    (0) 
    1. Prakash Darji Post author
      In the web application designer, change the button for printing and bind it to either a nested template without the images (print specific template) or choose the web item you want to print.

      Cheers,
      Prakash

      (0) 
  5. Parag Jain
    Hello Prakash,

    We have a requirement to display the query filters in a particular format in the PDF header (repeating across pages). We are able to generate this specific format via Javascript and store it in a hidden text / input webitem.

    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.

    Regards,
    Parag.
    PS: We are on BW SP12 / FrontEnd SP13.

    (0) 
    1. Prakash Darji Post author
      For option 1, you have to embed a dataprovider in a formatted report and then use the text element in a header block.

      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.

      (0) 
      1. Parag Jain
        Thanks Prakash.

        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.

        Regards,
        Parag.

        (0) 
  6. Erik van Wensveen
    hi Prakash,

    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.

    regards,
    Erik

    (0) 
    1. Prakash Darji Post author
      It’s been a while since I’ve done this, but last I checked, that web item wasn’t supported for export. You can use a print specific template though to print instead of this web application and that template wouldn’t use reusable nested web templates…

      The list of supported web items for printing is here:

      http://help.sap.com/saphelp_nw70/helpdata/en/43/68ce8391886e47e10000000a422035/content.htm

      I’d log a development request for this functionality, as I think it would be useful to get added.

      Cheers,
      Prakash

      (0) 
  7. Soumya Mishra
    Hi Prakash,

    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.

    Thanks
    Soumya

    (0) 
      1. Laurent THIBERT
        Hello,

        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…

        Thanks
        Laurent

        (0) 
  8. FW Sanyoto
    Hello Prakash,

    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.

    Fen

    (0) 
      1. Tobias Vogt
        Hi Prakash,

        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?
        Many thanks.

        Kind regards,

        Tobias

        (0) 
      2. Bob Sonntag
        Okay, so not a page break issue.  BEx Query Designer reports have a “Print Version” that produces the expected PDF file in our development and production environments.  In QA, it gets an Invalid Response 401 Unauthorized message.  We see the URL for the server then /AdobeDocumentServices/Config?style=document” in the long message text.

        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.

        Bob

        (0) 
        1. Steve Amorsen
          Bob,
          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.
          Thanks,
          Steve

          (0) 
  9. Standa Jager
    Hi all of you,

    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…)

    Thank you

    Standa

    (0) 
  10. Sebastian D'Souza
    Hi Prakash,

    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.

    Regards,
    Sebastian

    (0) 

Leave a Reply