Adds an object to the script's global namespace. This method allows scripts to become aware of custom classes contained within a project. Once an item has been added, the script can use the objectName string to reference the object and the functions contained within the class.
Syntax
Parameters
- objectName
- The name of the new object.
- objectReference
- The value of the new object.
Example
| C# | Copy Code |
|---|
//Add this code to the Class File public class clsMyItem
{
public clsMyItem()
{
}
public string getMyItem()
{
return "Hello";
}
}
//Add this code to the report private void rptAddNamedItem_ReportStart(object sender, System.EventArgs eArgs)
{
this.AddNamedItem("myItem", new clsMyItem());
} |
| Visual Basic | Copy Code |
|---|
Public Class clsMyItem
Public Function getMyItem() As String
getMyItem = "Hello"
End Function
End Class
Private Sub rptAddNamedItem_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart
Me.AddNamedItem("myItem", New clsMyItem())
End Sub
|
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also