Sunday, February 3, 2013

How to make Cognos Reports Reusable - Explore the new idea of authoring Cognos reports – part 3

Additional findings of layout component reference
(please check the part 1 and part 2)

Layout component reference is the main tool to be leveraged for report reuse. This section documents a few pitfalls


Copy vs. Reference (pro and con)

In case when you use Layout Component Reference from another report, you have two choices, reference or Copy. There are no options available in case when you use Layout Component Reference from the same report.


Using Layout Component Reference as reference reduces the effort of maintenance, and there is only once copy of this Layout Component Reference.  If you want to change it, you only need to change this Layout Component Reference in Library; all report reference it will be changed accordingly. The drawback is that there is runtime dependency on the Layout Component from that report, which could reduce the performance.
Using Layout Component Reference as Copy, and If you want to change it, you need to open all reports and to “Update all component copies”

The main drawback is that you need to remember to do update. However, this approach won’t bring any performance issue at all, as report specification is embedded into each report.

Conditional style is not carried over


When reusing layout component reference from another report, we need to copy query from another report, however, it is not enough, we need to recreate conditional style, as Cognos doesn’t provide a way to copy conditional style.

Click manager conditional style menu,



Then you need to figure out what is conditional style, make sure that conditional style name is same, and logic should be same as well.

Another thing to note is that you could experience problem when the conditional style name from another report already exists in current report. In this case, you need to rename the conditional style name from current report. The better way to do it is to give reused conditional style a very specific name to avoid any name conflicts.


Override limitation (singleton, no master detail)

When reusing layout component, we can override layout component as well. The only thing need to do is to define names for contained components you want to override. The override components could be anything, as long as you can give a name.
Please see sample below, there are text item and reusedSublist ,

You can simply override it without specifying any new components, meaning that the override component is simply suppressed. or you can drag new component into that area, report will consider that component as independent, as you can define any relationship between reused layout component and new dragged override component. However, if the component is not embedded, newly override component still can have relationship with its container.



Original report


New report 


using layout component with override text item, and simple suppress reusedSublist.

No comments:

Post a Comment