If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Floating Property Education

Started by craigalaniz, 21 Nov 2014 01:57:00 PM

Previous topic - Next topic

craigalaniz

Hi All

Could anyone explain to me the floating property of objects in Report Studio? I have googled and tested and still I am not getting it completely. I also have a specific qurestion.

Is the default behavior different for different objects that are placed on a page?

Example. I have a few charts that I place on a page,  each one to the right of the one before. Each one renders to the right when the report is run. When I place a 1 column 4 row table on the page, it drops down under all the graphs. I tried placing all these objects in 2 blocks and still the block with the table drops under the first block which contains the graphs. In the above example, none of the float properties have been changed from the default.

Any help would be appreciated.

Thanks

Craig

bdbits

Cognos reports are basically HTML pages, so I hope you understand a little HTML and CSS. My attempt at explaining some of this will assume you do.

Cognos blocks will usually render as HTML <div>s. Data containers (lists, crosstabs, etc.) and tables render as HTML <table>s. These are all block elements (as opposed to in-line), which by default will not be rendered with content on either side. Charts appear to be dynamically rendered <img>s blocks inside a table row, and if you have multiple charts they are images in a single row. Why Cognos puts them inside a single table row was a design decision, as far as I can tell.

The Cognos floating property does not appear to cleanly map to CSS styles, but will set a number of CSS styles depending on how other nearby objects have their floating property set. It appears to render as some combination of "clear" and "float" CSS styles. This makes the rendered page a bit more complicated to predict, to me anyway. Your specific example does make sense, though. When you drop the table on the report, it is a block-level element, so it drops below any preceding content and pushes any succeeding content down below it.

You might be able to massage Cognos into floating things as you would like, but personally I would probably add some Cognos "HTML Items" around the graphs/tables and supply my own CSS. Floating CSS blocks is usually considered a somewhat advanced topic for non-web-designer types like me, and it gets messy with differing browser interpretations and dependencies on display resolutions. If you google say "css block float clear" you will find quite a lot of articles about it, probably more than you wanted to know. But if you have a driving need to use it the best thing to gain an understanding is to mock up some pages outside Cognos,  and view the output with Firebug or other browser developer tools.

Honestly, if you want a lot of control you can do what web designers cringe at these days but is the easiest thing for Cognos reports - use tables to control your layout. That's what Cognos largely does in reports anyway. 8)

Hope that helped at least a little more than it confused the topic.

craigalaniz

Hello

Thanks for your reply. Yes, I a little HTML and CSS experience. Your answer helped a ton.

Thanks again.

Craig  ;D