Pick-up and apply style

We will see a very useful utility within Cognos Report Studio newly introduced from version 8.3 onwards.

Getting ready

We will use the same list report that we used in the last recipe for this.

How to do it...

  1. In this recipe, we will apply certain formatting to the list columns. Start by applying the following to the Product line column.

    Font: 12 pt

    Background Color: #FFFF99

    Border: 1pt solid lines on left and right. None for Top and Bottom.

  2. Select the Product line column. Hit the Pick-up Style buttonHow to do it... from toolbar.
  3. Now select Product type, Product name, and Product number columns from the list (by holding Ctrl key).
  4. Click the Apply Style button. How to do it...
  5. You will see that all the formatting, font, background color, and borders are applied to the selected columns.
    How to do it...
  6. Now again select the Product line column.
  7. This time click on the little dropdown (arrow) beside the Pickup Style button. Choose the Edit Dropper Style option.
    How to do it...
  8. This will open up a dialog box with the style already filled in. We don't want to copy the color for rest of the columns. We need only font and borders. So change the background color to Default.
    How to do it...

    Click the OK button to close the dialog.

  9. Now choose the rest of the columns from list (the ones which are not formatted). Hit the Apply Style button. Notice that the fonts and borders are applied to these columns and background color remains as default.
    How to do it...
  10. Run the report to test it.

How it works...

Pick Up Style and Apply Style are buttons added to Cognos Report Studio from version 8.3 onwards. They work in conjunction and are extremely useful to the report writer.

As you have seen in the recipe, it allows the writer to pick-up or copy the styling of an object and then apply it to one or more objects in the report. You can choose to apply all the styles (colors, fonts, border, alignments, padding, formatting, data format, images, and so on) or just apply the selected ones.

From experience, it is seen that a lot of time is spent in formatting the reports that have large number of columns, rows, aggregations, and so on. Also, this is the area causing cosmetic defects in the reports. Using this utility, we can save quite some time and prevent defects too.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset