Represents a report item that provides master detail relation during data-binding.
Namespace: MindFusion.Reporting
Assembly: MindFusion.Reporting
C# Copy Code |
---|
public class DataRange : ReportItem, IItemFactory |
Visual Basic Copy Code |
---|
Public Class DataRange |
If you want to bind Label, Picture or Canvas objects to a data source, you need to create an object of the DataRange class first and set its DataSource and DataMember properties to the appropriate values. Once this is done, you can add Label, Picture and Canvas objects to this DataRange (as well as any other non-bound report elements) and set their DataField property to the name of the field in the associated data source you want to bind them to. When the report is being processed, a new instance of the DataRange is created for each record in the associated data source. Then the values of the data-bound report elements contained in this data range are obtained from the respective fields in that record.
For more information on data-binding, check the Binding Reports to a Data Source.
The following example illustrates how to data-bind a Label report element through code. The example assumes that dataRange1 and label1 already reference DataRange and Label objects respectively, and that label1 is a child of dataRange1.
C# Copy Code |
---|
dataRange1.DataSource = myDataSource; dataRange1.DataMember = "MyDataMember"; label1.DataField = "MyDataField"; |
Visual Basic Copy Code |
---|
dataRange1.DataSource = myDataSource |
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
MindFusion.Reporting.ReportItem
MindFusion.Reporting.DataRange
MindFusion.Reporting.SideBySideContainer