- Select File | New | Project from the Visual Studio File menu. Select the Windows Application
project, give it a name and location. Click the OK button to close
- Right-click the project References and select Add
Reference from the context menu. Select the reference for the
class library containing your report from the list on the
Projects tab. Note: If the class library resides
in another solution you will need to use the Browse tab and navigate to the
assembly containing the report.
- From the ToolBox drag a Telerik ReportViewer control to the Windows form.
- Rebuild the Windows Forms project.
- In the Properties Window for the report viewer, open the ReportSource dialog, select
Instance Report Source and select the report we created in the class library.
Once an instance report
is selected, notice that a component representing the report appears in
the tray below Windows form designer. The component allows you to
access the properties of the report in your report viewing application,
providing access to report parameters, styles and page
- Add a call to the RefreshReport() method of the viewer in the form Load event:
private void MainForm_Load(object sender, System.EventArgs e)
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Copy the connection string which you saved in the application configuration file (app.config) of the report class
library, to the configuration file of your windows forms project. By default there is
no app.config so you can create a new one from Add -> New Item.
- Right-click the Windows report viewing application and
select Set as Startup Project from the context
- Press F5 to run the report.