[]
Adds the object to the global namespace of the script.
public void AddNamedItem(string objectName, object objectReference)
Type | Name | Description |
---|---|---|
string | objectName | A string value representing the name of the object to be used in the script. |
object | objectReference | An object value that references the object to be used in the script. |
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.
var sectionReport = new GrapeCity.ActiveReports.SectionReport();
sectionReport.Document.Printer.PrinterName = String.Empty;
sectionReport.CompatibilityMode = GrapeCity.ActiveReports.Document.CompatibilityModes.CrossPlatform;
var ctl = new GrapeCity.ActiveReports.SectionReportModel.TextBox{Name = "text1"};
sectionReport.Sections.Add(new GrapeCity.ActiveReports.SectionReportModel.Detail{Name = "Details"});
sectionReport.Sections[0].Controls.Add(ctl);
sectionReport.ScriptLanguage = "C#";
sectionReport.Script = @"public void Detail_Format(){text1.Text = text1Value;}";
this.AddNamedItem("text1Value", "Hello World!");
Type | Condition |
---|---|
ArgumentNullException | Thrown if the |