Documente Academic
Documente Profesional
Documente Cultură
Copyright
Copyright 2008 Cognos ULC (formerly Cognos Incorporated). Cognos ULC
is an IBM Company. While every attempt has been made to ensure that the
information in this document is accurate and complete, some typographical
errors or technical inaccuracies may exist. Cognos does not accept
responsibility for any kind of loss resulting from the use of information
contained in this document. This document shows the publication date. The
information contained in this document is subject to change without notice.
Any improvements or changes to the information contained in this document
will be documented in subsequent editions. This document contains
proprietary information of Cognos. All rights are reserved. No part of this
document may be copied, photocopied, reproduced, stored in a retrieval
system, transmitted in any form or by any means, or translated into another
language without the prior written consent of Cognos. Cognos and the
Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated)
in the United States and/or other countries. IBM and the IBM logo are
trademarks of International Business Machines Corporation in the United
States, or other countries, or both. All other names are trademarks or
registered trademarks of their respective companies. Information about
Cognos products can be found at www.cognos.com
This document is maintained by the Best Practices, Product and Technology
team. You can send comments, suggestions, and additions to
cscogpp@ca.ibm.com .
Contents
INTRODUCTION .......................................................................................4
1.1
Purpose ........................................................................................................................................4
1.2
Applicability................................................................................................................................4
1.3
APPENDIX A.................................................................................................12
Cascading Style Sheets, level 2 CSS2 Specification ........................................................................... 12
1 Introduction
1.1
Purpose
The purpose of this document is to provide guidelines when authoring reports
to align report objects such as lists, crosstabs and tables to render
consistently in PDF as well as HTML formats.
1.2
Applicability
The content of this document is derived from testing in IBM Cognos 8.2, but
is based on standard rendering rules for PDF and HTML, and can be applied
to earlier versions of IBM Cognos 8 and IBM Cognos ReportNet.
1.3
2.1.5 Develop and test to make sure that data in the unformatted report
is correct before altering the layout.
Troubleshooting incorrect results is made more difficult when the report contains
complex layout/formatting "on top of" the results.
2.1.8 Create report templates, once the basic building blocks are in place.
Top border = 1 px
1st row White space = 19 px
Center border = 1 px
2nd row White space = 18 px
Bottom border = 1 px
Total height = 40 px.
It is important to understand this behaviour when stacking 2 (or more) separate
tables on the left, for example, and aligning them with 1 object on the right, as the
HTML output on the left will appear shorter than on the right side.
This does not happen for PDF output - all rows are equal in white space. Using the
example table object, the result on PDF will be 1 px larger than specified, as the
border at the bottom will be pushed out. The total height will thus be 41 pixels in
PDF, and 40 pixels in HTML.
3 Rules of Practice
3.1.1 RULE #1: For PDF output, do not use percentage sizes for width /
height.
Always specify size in pixels, or fixed measure units. If percentage sizing for HTML
output is a critical requirement, use conditional layouts based on the output format to
generate one layout for PDF and one for HTML.
3.1.2 RULE #2: Do not use Box Type of None to hide elements.
When elements must be hidden, remove the contents of the container and set the
class to none, or set the visible property to false. This will make the object invisible,
without removing its control over the height or width settings.
Example: List Column Titles - set the Column Titles property to hidden.
3.1.4 RULE #4: Check "Fixed Size" property in the "Table Properties"
Fixed Size will ensure that the size values in the object properties are honoured, and
Report Studio will show a true reflection of what to expect in an HTML output. This is
required for consistent results between different output formats.
10
Set Style to None, and click the black square (below Preview) to remove borders,
while retaining size properties. Ensure the dotted lines are visible:
11
12
Appendix A
Cascading Style Sheets, level 2 CSS2 Specification
Detailed explanations of all the key elements involved when dealing with HTML tables
can be found at the following W3C reference site:
W3C Recommendation 12-May-1998 http://www.w3.org/TR/REC-CSS2/tables.html