The quick start guide familiarizes you with some of the features of FlexReport for WPF. In this section, you learn to create a report definition, load and render the report to FlexViewer control.
Create a report definition using the FlexReportDesigner application or code. The easiest way to create a report definition is to use the stand-alone C1FlexReportDesigner desktop application that ships with FlexReport.
The C1FlexReportDesigner.4.exe (runs in 64-bit mode on 64-bit systems, and in 32-bit mode on 32-bit systems) and C1FlexReportDesigner32.4.exe (always runs in 32-bit mode) are located in C:\Program Files (x86)\ComponentOne\Apps\v4.0 folder on your computer.
To create a simple WPF application using the FlexReport for WPF, follow these steps:
Create a new report definition in FlexReportDesigner application using FlexReport Wizard. To create a report definition, follow these steps:
You can find the C1Nwind.mdb database in Documents\ComponentOne Samples\Common folder. |
To load a report definition from a file, follow these steps:
Dim rep As New C1FlexReport() 'load report definition rep.Load("..\..\Products Report.flxr", "Products Report")
C1FlexReport rep = new C1FlexReport(); //load report definition rep.Load(@"..\..\Products Report.flxr", "Products Report");
Once the report definition has been created and loaded into C1FlexReport, you can render the report to the C1FlexViewer control. To render the report, add the following code to the Button_Click event in the code view:
'preview the report
Viewer.DocumentSource = rep
//preview the report
Viewer.DocumentSource = rep;
This is how the report appears on rendering to FlexViewer.