Tuesday, January 1, 2013

How to keep PDF size of list or crosstab not be impacted by chart on same page


Context
When generating PDF page containing both list, or crosstab and chart on same page, it is very important to make sure that your chart size should be smaller than or equal to the page size.  As known, there is no problem for list or crosstab, as PDF engine will automatically separate list or crosstab into multiple pages, but keep original predefined layout and font size. However, chart behaves completely different, it will change list or crosstab layout or font size when page containes a chart whose size is bigger than page.

Samples

In this sample, there is a list and a chart. PDF page uses letter size. please download report specification for review in detail.

Chart size is defined 750px


The PDF attached below, you can see list occupies more than more 50% page width


Now change width to 1500

Then you can see the list size changes, layout and font size reduce almost 50%

Please download sample for review in detail


Note

This situation becomes very important when generating multiple page, or report book (see old post How to customize reports tailored to individual customer with table of contents), as all font and layout need to be consistent.

There could be other solution if you really want to keep chart defined as big size. In this case you can change list or crosstab layout and font size proportionally. For example, amplify 1500/768 times; you can get it same size for user.

In case when you really want to keep list or crosstab within one page, One solution is to manually build a new page or conditional block to make sure that the report is fit to one page. The disadvantage is that one needs to make this new page and conditional block for PDF with other font size, or layout. The solution from link (http://www.ibm.com/developerworks/data/library/cognos/reporting/layout_and_formatting/page585.html)


 The idea is to define custom size in PDF setup for the report, then print out by using the default option of 'Shrink to Printable Area'.


NOTE:
1) Cognos converts units using 1 inch = 72 points = 96 pixels
2) HTML and PDF show charts differently. By default, a chart is rendered as 500 pixels wide by 400 high. If you set a chart to have a specific width and height, like 5 inches wide by 2 inches high, it will be rendered in PDF as 480 pixels wide and 192 pixels high, and in HTML it would also be displayed at that pixel size.
3) for a page size of 8.5x11" portrait, you actually have 7.5" wide by 10" high within the page. 
4) In PDF if the contents of the page are wider or higher than what will fit, the page is "shrunk to fit". You can see this by creating a wide list - wider than the 7.5" and running it with PDF output. This can lead to very small objects, or text on the printed output.
5) In HTML, if the contents are wider than fit in the browser window, it uses scroll bars.
6) Charts in HTML whose size is set as a percentage can generate ugly output. If you put a chart on a 8.5x11" page, and set the chart's width to 100%, you would expect the chart to be 7.5" wide. But instead it is generated in its default size (500 pixels wide) and then "image stretched" to fit the expected width.
7) A4 sample size : 8.5x11" = 816 x 1056 pixels ; 7.5 x 10" = 720 x 960  pixels;   IPAD 704 x 1024 pixels;  

6 comments:

  1. There's definately a great deal to learn about this topic.
    I really like all the points you've made.

    Here is my blog post :: http://maineseo.org

    ReplyDelete
  2. I believe that is among the so much important info for me.
    And i'm satisfied reading your article. However should remark on some basic issues,
    The site taste is wonderful, the articles is in point of fact nice : D.
    Excellent activity, cheers

    my homepage: Lean Muscle Mass HGH

    ReplyDelete
  3. Thankfulness to my father who stаteԁ to mе abou&X74; thiѕ webl&X6f;g, thіs blog is really
    amazing.

    my homepage ... facebook

    ReplyDelete
  4. After checking out a few of the blog articles on your web site, I truly appreciate your technique of blogging.
    I saved it to my bookmark webpage list and will be checking back in the near future.
    Take a look at my web site as well and tell me your opinion.


    Feel free to surf to my weblog ... new 3d printers

    ReplyDelete
  5. What's up, I wish for to subscribe for this web site to obtain newest updates,
    therefore where can i do it please help out.

    My web site - Buy Garcinia Total

    ReplyDelete
  6. Very energetic article, I loved that bit. Will there be a part
    2?

    my weblog: raja

    ReplyDelete