Progress® Telerik® Reporting R2 2017

DataItemNeedDataSource Event

Occurs when the processing of the data item processing instance (i.e., DataItem instance) begins and this instance has no DataSource property set.

Namespace:  Telerik.Reporting
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

public event EventHandler NeedDataSource

Value

Type: SystemEventHandler

Remarks

The event is hooked on the definition DataItem instance, but the sender object in the event handler is the processing DataItem instance. The processing instance of the data item inherits its DataSource from the definition instance, but if neither has DataSource set, this event is raised.

Examples

The following example demonstrates how to implement a NeedDataSource event handler:
void table1_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.DataItem processingDataItem = (Telerik.Reporting.Processing.DataItem)sender;
    Telerik.Reporting.Processing.Report processingReport = processingDataItem.Report;
    object processingParameterValue = processingReport.Parameters["parameter1"].Value;
    processingDataItem.DataSource = GetData(processingParameterValue);
}

static object GetData(object value)
{
    // Implement your custom data retrieval logic instead
    return new string[] { "Sofia", "London", "Tokyo" };
}

See Also