7.9.2  CSS Styles

The Attributes tab of every element's 'Properties' dialog box contains properties relating to the appearance and formatting of the element. Among these properties, the following can also be set by using CSS (Cascading Style Sheets) styles:

font

background color

foreground color

To set an element's properties by using CSS, follow the steps below:

1. Using a text editor, create a CSS file containing the desired class definitions.

For example, create a text file called 'myStyle.css' containing the definition for a 'header2' class:

.header2 {

   font-size: 22pt;

   font-family: "Verdana", sans-serif;

   font-weight: bold;

   background-color: rgb(100,100,100);

   foreground-color: rgb(200,200,255);

}

2. Save the CSS file (e.g., myStyle.css).

See Report Proper­ties for more informa­tion.

3. Select 'Report Properties' from the Style Studio File menu. This opens the 'Properties' dialog box.

4. Click the Options tab.

See Configuring the Style Studio Class­path in Getting Started for informa­tion about classpath directories.

5. In the 'CSS Location' field, enter a resource or absolute path for the CSS file. For example, if the file 'myStyle.css' resides in a directory on the classpath, simply enter '/myStyle.css' as the 'CSS Location'.

 

6. Click 'OK' to close the dialog box.

7. Right-click the element in the report to which you want to apply the CSS style, and select 'Properties' from the context menu. This opens the 'Properties' dialog box.

8. In the 'CSS Class' field, select or type the name of a class that will define the element's style. (Example: Class 'header2' for a Text element.)

 

The specified formatting will be applied to all elements that are assigned the given class, and the CSS style overrides the corresponding settings in the 'Properties' dialog box.

<< 7.9.1 Adding HTML to a Report © 1996-2013 InetSoft Technology Corporation (v11.4) 7.10 Page Areas >>