We will create our own stylesheet using the Style Definition Editor UI, then save it, and look at the XML code that has been created. Then we will assign the stylesheet to our report.
horizontal-line[style-class="Designer"]
#339900
The CSS rule says that it will apply the style (green color) to all the horizontal lines that have the value Designer
in their Attributes.style-class.
horizontal-line[style-class="Admin"]
#f02929
The CSS rule says that it will apply the style (red color) to all the horizontal lines that have the value Admin
in their Attributes.style-class.
report-header label[style-class="Designer"]
18
true
The CSS Rule says that it will apply the style (large and bold font) to all the labels in the Report Header section that have the value Designer
in their Attributes.style-class.
report-header label[style-class="Admin"]
true
The CSS Rule says that it will apply the style (italic) to all the labels in the Report Header section that have the value Admin
in their Attributes.style-class.
[xml-id="r3_Designer"]
false
This CSS Rule says that it will apply the style (invisible) to the node (section or object) that has the value r3_Designer
configured in its Attributes.xml-id.
styles.prptstyle
.styles.prptstyle
in your favorite text editor. In the part designated for CSS rules we should find something like this:<rule> <selector>horizontal-line[style-class="Designer"]</selector> <styles> <content-styles color="#339900"/> </styles> </rule> <rule> <selector>horizontal-line[style-class="Admin"]</selector> <styles> <content-styles color="#f02929"/> </styles> </rule> <rule> <selector>report-header label[style-class="Designer"]</selector> <styles> <content-styles color="#00cc99"/> <text-styles bold="true"/> <text-styles font-size="18"/> </styles> </rule> <rule> <selector>report-header label[style-class="Admin"]</selector> <styles> <content-styles color="#ff6600"/> <text-styles italic="true"/> </styles> </rule> <rule> <selector>[xml-id="r3_Designer"]</selector> <styles> <common-styles visible="false"/> </styles> </rule>
If we pay attention to the XML code, we will see that it is very simple, and with a little practice we can even create our Stylesheets without having to use the PRD UI.
We opened the Style Definition Editor UI and using the option Add Style-Rule we added one by one of the CSS rules proposed in the exercise. We created CSS rules that take into account the name of the user who is currently logged in. We created CSS rules for Designer
, the PRD default user, and for Admin
, a Pentaho BA Server user. Finally, by using Attributes.style-sheet-reference, we assigned the stylesheet we just created to the Master Report node.