FlexReport for UWP | ComponentOne
FlexViewer for UWP / Binding FlexReport with FlexViewer
In This Topic
    Binding FlexReport with FlexViewer
    In This Topic

    To render a report, you need to load the report first. Once the report definition has been created, a data source is defined, and the report definition is loaded, you can render the report to the FlexViewer control.

    To preview the report in FlexViewer control, use the following code:

    Try
        ' load from resource stream
        Using stream As Stream = asm.GetManifestResourceStream("BindingApp.Resources.TelephoneBillReport.flxr")
        rpt.Load(stream, "TelephoneBillReport")
    End Using
    Catch ex As Exception
            Dim md As New MessageDialog(String.Format("Failed to Load Report", rpt.ReportName, ex.Message), "Error")
            Await md.ShowAsync()
            Return
    End Try
    
    Flxviewer.DocumentSource = rpt
    
    try
    {
     // load from resource stream
     using (Stream stream = asm.GetManifestResourceStream("BindingApp.Resources.TelephoneBillReport.flxr"))
     rpt.Load(stream, "TelephoneBillReport");
    }
    catch (Exception ex)
    {
     MessageDialog md = new MessageDialog(string.Format("Failed to Load Report", rpt.ReportName, ex.Message), "Error");
     await md.ShowAsync();
     return;
    }
                
    Flxviewer.DocumentSource = rpt;