Grab them all practice

This recipe will tell you about something which is good practice. But I have put it under 'Using Report Studio Better' for two reasons. One—it builds upon the idea learnt in previous recipe. Two—it does help you use Report Studio better.

The last recipe showed you how to apply style to selected list columns. Here we will see the recommended way to apply same style to all the objects (List Column Titles in this case).

Getting ready

We will continue working on the report that we modified in the last recipe.

How to do it...

  1. Say we want to apply the following style to all the list column titles.

    Font: 12 Pt

    Background Color: Silver

    Border: 1pt Solid all sides

    Then we have two options. First apply this style to one column title. Say Product line code.

    How to do it...
  2. Now do the same Pick-up Style and Apply Style to all column titles as learnt in the previous recipe.
  3. Run the report to test it and you will see that it works.
    How to do it...
  4. However, if you drag a few more columns on the list, you will see that the formatting needs to be re-done on them.
    How to do it...
  5. To avoid this problem, let's learn another technique. Remember that we want to apply the same formatting to all column titles. So, undo all the change we did to the report in this recipe. Bring it back to the original state as we left it in the last recipe.
  6. Now select any one list column title.
  7. Using the Ancestor button How to do it... in Property pane, choose List Column Title Style. You will notice that all column titles are selected.
  8. Now apply the required formatting (color, border, and font in this example).
    How to do it...
  9. Run the report to test it.
  10. Add some new columns to the list. Notice that the column titles already have consistent formatting.
    How to do it...

How it works...

What we are doing here is, instead of selecting the column titles individually, making a general selection of 'List Column Title Style' that applies to all column titles. In fact it is a parent object, so even the new items added later on to the list will fall under it and will carry same formatting.

This practice of selecting a generic or parent-level object not only saves time but also makes the formatting more future-proof. A report writer should follow this 'grab it all' practice for the formatting that applies across.

There's more…

Please don't miss the 'Customizing Classes for report-wide effect' recipe in Chapter 11, Best Practices; to further enhance the technique of applying a universal style to the report.

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

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