Crystal Reports  

Formatting Reports using HTML Classes

Instead of formatting report objects or sections in the Crystal Reports ActiveX Designer, you can use classes in a cascading style sheet (CSS) to apply formatting to reports viewed over the Web.

Generally, when you create a report, you format a particular report object (for example, a database field or text object) within the Crystal Reports ActiveX Designer. When the report is rendered into HTML and viewed, these formatting options are automatically converted into HTML. To change the formatting of the HTML page, you would need to make a change to the Crystal report itself.

The Set CSS Class option enables you to apply classes to report objects and to sections of a report, instead of manually changing the formatting of the report. You specify the name of the class and its scope in the Crystal Reports ActiveX Designer and then specify the value of the class within your web application files or through an external style sheet. The formatting specified is then applied to the report when the report is rendered into HTML.

To format reports using HTML class values

  1. Right-click in the Crystal Reports ActiveX Designer and select Set CSS Class.
  2. In the Object Scope field, select the objects or sections you would like the class to be applied to.
  3. Enter the name of the class in the CSS Class Name field.
    Tip   Use CssClass in the Properties window to view, edit, or delete the class values for a specific report object or section.
  4. Click OK.
  5. Save the report.
  6. In the web application file, reference an external style sheet that has the class already defined, or enter the class value.

    For example:

    <HTML>
       <STYLE>
    .classname
    {
       background-color:808080; border-color:000000; color:000000; font-family:Arial; font-weight:bold; font-style:italic; }
       <STYLE>
    </HTML>

See Also

Absolute Formatting | Conditional Formatting | Formatting Report Sections | Enhancing Report Presentation