You can set custom style values using the Report Settings window, and then apply the styles to controls using the ClassName property in the Properties Window. If you want to apply these same styles to controls in other reports without setting them up each time, you can export them to XML files of type *.reportstyle which you can then select in the Report Settings window. Reports using external style sheets have these styles applied before the report is run.
To save an external style sheet
![]() |
To import an external style sheet at design time
To apply an external style sheet at run time
To make a style sheet available at run time, double-click the grey area of the report to create an event-handling method for the ReportStart event of the report. Add code inside the handler to make the style style sheet available to the report.
The following examples show what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the ReportStart event. |
Copy Code |
---|---|
Me.LoadStyles("C:\My.reportstyle") |
C# code. Paste INSIDE the ReportStart event. |
Copy Code |
---|---|
this.LoadStyles("C:\My.reportstyle"); |
To apply styles to controls at design time
You can apply styles to four types of ActiveReports controls: CheckBox, Label, TextBox, and ReportInfo.
To apply styles to controls at run time
You can apply styles to four types of ActiveReports controls: CheckBox, Label, TextBox, and ReportInfo.
To apply a style at run time, double-click the section of the report containing the control to create an event-handling method for the Format event of the section. Add code inside the handler to apply the style to the control.
The following examples show what the code for the method looks like.
Visual Basic.NET code. Paste INSIDE the Format event. |
Copy Code |
---|---|
Me.TextBox1.ClassName = "Heading1" |
C# code. Paste INSIDE the Format event. |
Copy Code |
---|---|
this.textBox1.ClassName = "Heading1"; |