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

Can I copy header and footer and paste it in another report?

Started by marzbuzz, 19 Aug 2014 04:55:59 PM

Previous topic - Next topic

marzbuzz

Hi All,

I am new to Cognos Report Studio. The version of the Cognos I'm using is v10.2.

There are about 40 Reports and I need add header and footer for all of them. Can I copy header and footer from the one I already added and paste it in other reports? Can any one suggest any easy way to do this?

TIA,
MB

bdbits

For things like this, I would recommend layout component references. This also lets you change all of your reports by making a change in one place.

Basically, you create a stand-alone "report" to hold your standard report objects, in your case headers and footers. On your reports, drop a layout component reference on your report from the toolbox, then select the component from the dialog that pops open. It's very slick, we are now using this on quite a few projects here.

You can find more information about layout component references in Report Studio help.

MFGF

Quote from: bdbits on 19 Aug 2014 05:37:47 PM
For things like this, I would recommend layout component references. This also lets you change all of your reports by making a change in one place.

Basically, you create a stand-alone "report" to hold your standard report objects, in your case headers and footers. On your reports, drop a layout component reference on your report from the toolbox, then select the component from the dialog that pops open. It's very slick, we are now using this on quite a few projects here.

You can find more information about layout component references in Report Studio help.

I agree with Bob - layout component references will be your best bet here. In the "template" report (ie the one where your header and footer are actually defined) you need to make sure that the container for each has a name specified (in properties) to be able to reference it from elsewhere. If your header is defined within a block, for example, give the block a name. When you are in your other reports and you drag in a layout component reference, you can point this at your "template" report and it will then display the objects in this report with names specified. If you haven't specified a name, you can't reference it.

Cheers!

MF.
Meep!


marzbuzz

Thanks Guys! Layout component References works like a charm.  :)

One more question, am I able to add the layout component reference on top of another existing header which have report name information? (I don't want use <%reportname()%> since there is underscore in the report name.) I am able to add a table below the current header and insert the layout component reference inside. I just wonder if I can add it on top of the current header without redo it from scratch.

TIA,
MB

bdbits

You might be able to layer stuff for HTML, but I do not know if that would work well for say Excel or PDF output. But, for something like a report header, try this.

Go into your component 'report'. Create a typical 3x1 table to hold the header, and give the table a name like rpthead. I am assuming you want the report name in the middle, so drop a text item in the middle cell, giving it a name like rptname. Save the component report and open a report you want to implement this on. Drop the layout component reference on the report and link it to rpthead. Now look at the properties for the layout component reference object, and click the ellipsis (three dots) after Overrides. Put a checkbox on rptname and click OK. Now you can drop a new text object where rptname would be in the source component (or another object type if you like) and style it as desired. So this lets you put something in the midst of other standard stuff around it.

Note that fonts and such on your new object will be inherited from the parent. In my example that would be the table, but you probably don't want the entire heading all one font size. So in rptname, drop a block in the middle instead of a text item. Set the font style, etc. on the block. Now drop the text item inside the block. In the target, the text item override will inherit the block-level styling.

Hope that helps.

marzbuzz

bdbits,

Is your solution able to add report name in the layout component reference that I already built? Anyway, I think my case is simpler. I want to reuse the current header which have information other than just report name. The layout component reference that I created is the company logo that I want to add above all the other information in the current header. However, when I insert table in the current header, it is always added under it.

TIA,
MB

bdbits

What I was laying out was a way to modify (override) a piece of the source layout component.

If the problem is just the position of the logo, solving that depends on what the source component is made up of and how the target report is laid out. You can nest tables, or insert a named sub-component (e.g. just an image), and you can insert most things inside an existing table cell. How all this interacts can depend on the sum of the properties of the objects involved.

Could you attach a report spec from an existing report, and your source component? It is kind of tough to visualize what is going on really.

marzbuzz

Thanks bdbits!

I've figured it out. When I use insert table menu ->insert table options, I am able to insert on the top of the existing table. Before, I use 'insert table' on the tool bar and it only allowe me to insert below the existing table.   

I'm glad that I found this forum and thanks for all the suggestions.. :)

MB