MESCIUS.ActiveReports Assembly / GrapeCity.ActiveReports.Document Namespace / PageDocument Class / LocateDataSource Event
Example

LocateDataSource Event (PageDocument)
Occurs when the report needs to locate a data source from the calling application.
Syntax
'Declaration
 
Public Event LocateDataSource As LocateDataSourceEventHandler
 
Event Data

The event handler receives an argument of type LocateDataSourceEventArgs containing data related to this event. The following LocateDataSourceEventArgs properties provide information specific to this event.

PropertyDescription
The data returned by the event handler.  
Gets the report's GrapeCity.ActiveReports.PageReportModel.IDataSet object to locate data for.  
Gets the Parameters collection specified for a given report instance.  
Gets the Report that is trying to locate the data set.  
Example
PageReport pageReport = new PageReport(reportFilePath);
pageReport.Document.LocateDataSource  += (sender, args) =>
{
	if (args.DataSet.Name == "Catalog")
	{
		DataSet ds = new DataSet();
		ds.ReadXml("XML_Schema_and_Data.xml");
		args.Data = ds.Tables[0];
	}
};
reportPreview.LoadDocument(pageReport.Document);
See Also