Search results
Suggest a FeaturePDF

Report interaction events

You can handle the report processing actions and interact with reports using the following events.

  • ReportLoaded
  • ReportError
  • Drill through

Report loaded

The ReportLoaded event fires once the report loading is completed and ready to start the processing. You can handle the event and specify data source, parameters at client-side. The following sample code loads a report by assigning report data source input in the ReportLoaded event.

In this tutorial, product-list.rdlc report is used, you can add the report from Bold Reports® installation location. For more information, see Samples and demos.

Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly;
Stream reportStream = assembly.GetManifestResourceStream("ReportViewer_UWP.Resources.product-list.rdlc");

this.ReportViewer.ReportLoaded += (sen, arg) =>
{
    this.ReportViewer.DataSources.Clear();
    this.ReportViewer.DataSources.Add(new BoldReports.UI.Xaml.ReportDataSource { Name = "list", Value = ProductList.GetData() });
};

this.ReportViewer.ProcessingMode = BoldReports.UI.Xaml.ProcessingMode.Local;
this.ReportViewer.LoadReport(reportStream);
this.ReportViewer.RefreshReport();

Report error

When an error occurs in the report processing, it raises the ReportError event. You can handle the event and show the details in your custom dialog instead of component default error detail interface.

this.ReportViewer.ProcessingMode = BoldReports.UI.Xaml.ProcessingMode.Local;
Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly;
Stream reportStream = assembly.GetManifestResourceStream("ReportViewer_UWP.Resources.product-list.rdlc");

this.ReportViewer.ReportError += (sen, arg) =>
{
    //Handle your report error options here.
}

//this.ReportViewer.LoadReport(reportStream);
this.ReportViewer.RefreshReport();

Drill through

When a drill through item is selected in a report, it invokes the DrillThroughReport event. You can change the drill through arguments such as report parameter and data sources. The following sample code can be used to change the drill through report name and set the parameter value before the drill through report is rendered.

this.ReportViewer.DrillThroughReport += (sen, arg) =>
{
    List<BoldReports.UI.Xaml.ReportParameter> parameters = new List<BoldReports.UI.Xaml.ReportParameter>();
    BoldReports.UI.Xaml.ReportParameter parameter = new BoldReports.UI.Xaml.ReportParameter();
    parameter.Name = "EmployeeID";
    parameter.Values = new List<string>() { "4" };
    parameters.Add(parameter);

    //Assign the drill through report path and parameter
    arg.ReportPath = "~/Resources/docs/personal-details.rdl";
    arg.Parameters = parameters;
};

this.ReportViewer.ReportServiceURL = @"https://demos.boldreports.com/services/api/ReportViewer";
this.ReportViewer.ReportPath = "~/Resources/docs/sales-person-details.rdl";
this.ReportViewer.RefreshReport();
CONTENTS
Having trouble getting help?
Contact Support
CONTENTS
Having trouble getting help?
Contact Support