FlexViewer for WPF > Binding FlexReport with FlexViewer |
The purpose of binding FlexReport with FlexViewer is to be able to preview the FlexReport in FlexViewer control. To bind the FlexReport with FlexViewer control, you first need to create a report definition (.flxr) and load it in C1FlexReport object. Once the report definition is loaded in C1FlexReport, it can be viewed in the FlexViewer control. C1FlexViewer allows you to bind FlexReport with the FlexViewer control using DocumentSource property of C1FlexViewer class. The DocumentSource property takes the value from C1FlexReport object, which contains the report definition.
To preview the report in FlexViewer control, use the following code:
'load report definition FlexReport1.Load("..\..\Products Report.flxr", "Products Report") 'preview the report Viewer.DocumentSource = FlexReport1
//load report definition FlexReport1.Load(@ "..\..\Products Report.flxr", "Products Report"); //preview the report Viewer.DocumentSource = FlexReport1;