Progress® Telerik® Reporting R2 2017

ReportNeedDataSource Event

Occurs when the processing of the report processing instance (i.e., Report 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 Report instance, but the sender object in the event handler is the processing Report instance. The processing instance of the report 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 report_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.Report processingReport = (Telerik.Reporting.Processing.Report)sender;
    object processingParameterValue = processingReport.Parameters["parameter1"].Value;
    processingReport.DataSource = GetData(processingParameterValue);
}

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

See Also