Expand Minimize
This topic has not yet been rated - Rate this topic

Code Element

SQL Server 2000

Code Element

Contains definitions for custom functions to be used in the report.

<Report>
   ...
   <Code>...</Code>
   ...
</Report>
Element Characteristics

Characteristic Description
Data type and length String
Default value None
Cardinality 0-1: Optional element that can occur once or not at all

Element Relationships

Relationship Element
Parent element Report
Child element None

Remarks

Functions contained within the code element must be written in Visual Basic .NET and must be instance methods. For information about writing custom code and using the functions contained within the Code element in a report, see Writing Custom Code.

The code from the Code element of a report and from your custom assemblies are instantiated into a Code object when the report is run. In some cases, you may need to override the default OnInit method for this object to initialize the your custom classes with values from the global collections in the report. For information about initializing the Code object using OnInit, see Initializing Custom Assembly Objects.

See Also

Report Definition XML Elements

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.