solanki dev
solanki dev

Reputation: 27

How To Use ReportViewer

//Declare a object

 ReportViewer rv = new ReportViewer();

Error 1

The type 'System.Windows.Forms.UserControl' is defined in an assembly that is not referenced. 

You must add a reference to assembly

 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. c:\users\dsingh\documents\visual studio 2012\Projects\Rd\Rd\MainWindow.xaml.cs  27  13  Rd

Upvotes: 0

Views: 307

Answers (1)

Shaminder Singh
Shaminder Singh

Reputation: 1293

Your error itself answers your question, try adding windows forms assembly. Follow the following Steps

  1. Right click on your project in Visual Studio
  2. Click on Add Reference option
  3. Click on .Net Tab
  4. Scroll For System.Windows.Forms Component Name
  5. Click on Add Reference

and don't forget to add reference in the window or page start tag. Follow the link provided in the below comment from FredrikRedin

Upvotes: 1

Related Questions