Glossary Item Box

Concepts: Scripting

See Also ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Add Named Item

Use the AddNamedItem method to access class files in a project.

The AddNamedItem method is used to allow the script to gain access to functions in a class file contained within a project. This can be useful for allowing secure information such as a database connection string or a SQL query string to be used in the script without having to save it into the RPX file.

[C#] public class clsMyItem { public clsMyItem() { } public string getMyItem() { return "Hello"; } }

[Visual Basic] Public Class clsMyItem Public Function getMyItem() As String getMyItem = "Hello" End Function End Class

[C#] private void rptAddNamedItem_ReportStart(object sender, System.EventArgs eArgs) { this.AddNamedItem("myItem", new clsMyItem()); }

[Visual Basic] Private Sub rptAddNamedItem_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles MyBase.ReportStart me.AddNamedItem("myItem", new clsMyItem()) End Sub

[Script] public void Detail_Format() { rpt.Label1.Text = myItem.getMyItem(); }

Concepts: Scripting

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.