A newer version of this page is available.
Switch to the current version.
XtraReport.ScriptsSource Property
Specifies the report scripts.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v18.2.dll
Declaration
[DefaultValue("")]
[Browsable(false)]
public string ScriptsSource { get; set; }
<DefaultValue("")>
<Browsable(False)>
Public Property ScriptsSource As String
Property Value
Type | Default | Description |
---|---|---|
String | A String value, storing the code of all report scripts. |
Remarks
Use the ScriptsSource property to assign or access report scripts at runtime.
Before assigning the XtraReport.ScriptsSource in code, make sure to specify the XRControl.Name for each added report control. Otherwise, running the script will cause an exception, because the default control name is undefined.
The following code illustrates the correct approach.
XtraReport report = new XtraReport();
report.Bands.Add(new DetailBand());
XRLabel label1 = new XRLabel();
label1.Name = "label1";
report.Bands[0].Controls.Add(label1);
XRLabel label2 = new XRLabel();
label2.Name = "label2";
report.Bands[0].Controls.Add(label2);
this.ScriptsSource = "int i = 0;";
ReportPrintTool pt = new ReportPrintTool(report);
pt.ShowPreviewDialog();
Examples
See Also
Feedback