ActiveReports for .NET 3 Online Help Request technical support
Walkthrough: Style Sheets
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Standard Edition Walkthroughs > Basic > Walkthrough: Style Sheets

Glossary Item Box

ActiveReports adds style class names to allow controls to be formatted easily. With the use of style sheets, groups of controls can be set to a single style with just a few clicks. ClassName and the different controls' Style property can also be used to create specialized styles in code and through scripting.

This walkthrough illustrates how to create and use style sheets in a report.

This walkthrough is split up into the following activities: 

Opening an existing ActiveReport

To open an existing ActiveReport  

  1. From the File menu of Visual Studio, select Open > Project.
  2. Navigate to your ActiveReport project and click on it to select it.
  3. Click Open.

Creating Style Sheets

To create a style sheet

  1. Click anywhere on the report design surface to select it.
  2. From the Report menu, select Settings.
  3. Click on Styles to display the style sheet.
  4. Click New to add a new style, or select a predefined style to modify.
  5. Name the new style "MyNewStyle" and select a base style.
  6. Modify the properties to set up the desired effect and click OK.

Using Created Style Sheets in a Report at Design Time

To use a created style sheet at design time

  1. Click on the control to which you wish to apply the style.
  2. Set the ClassName property to MyNewStyle.
  3. The new style is applied to your selected control.

Using Created Style Sheets in a Report at Run Time

To write the code in Visual Basic or C#

Viewing the report

To view the report

  1. Add the ActiveReports viewer control to a Windows Form.
  2. Add the code needed to set the viewer document equal to the report document. See Using the ActiveReports Windows Form Viewer for help.
You can quickly view your report at design time by clicking the Preview tab at the bottom of the designer.

See Also

©2009. All Rights Reserved.