How to hook into load data method

In order to hook into load method you need to open service class in the server side project and override OnLoadData method, for example:

[AspNetCompatibilityRequirements(RequirementsMode =
        AspNetCompatibilityRequirementsMode.Required)]
public class ReportService : ReportServiceBase
{
...
    protected override void OnLoadData(IDictionary<string, object> parameters,
                   string reportName,
                   PerpetuumSoft.Reporting.Components.ReportSlot reportSlot)
    {
        base.OnLoadData(parameters, reportName, reportSlot);
        DataRow row = dataTable1.NewRow();
        row["Name"] = "Johnson Leslie";
        row["Phone"] = "613-442-7654";
        dataTable1.Rows.Add(row);
        row = dataTable1.NewRow();
        row["Name"] = "Fisher Pete";
        row["Phone"] = "401-609-7623";
        dataTable1.Rows.Add(row);
        row = dataTable1.NewRow();
        row["Name"] = "Brown Kelly";
        row["Phone"] = "803-438-2771";
        dataTable1.Rows.Add(row);
    }
...
}

Add Feedback