title: Use a DataGridView as data source to Report Viewer
body: <p>I'm trying to use a DataGridView as a data source to my report, I want to show the table in DataGridView in my report. I searched and the code that I found here in SO tell me to do something like that: </p>
  
  <p>Button that generates the report</p>
  
  <pre><code>private void GenerateReport_Click(object sender, EventArgs e)
  {
      ReportForm reportForm = new ReportForm(DataGrid);
      reportForm.ShowDialog();
  }
  </code></pre>
  
  <p>in my report form:</p>
  
  <pre><code>private DataGridView grid;
  
   private void ReportForm_Load(object sender, EventArgs e)
   {
       DataTable dt = (DataTable)grid.DataSource;
       dt.TableName = "reportSource";
  
       reportViewer1.ProcessingMode = ProcessingMode.Local;
       ReportDataSource rds = new ReportDataSource("reportSource", dt);
       reportViewer1.LocalReport.DataSources.Clear();
       reportViewer1.LocalReport.DataSources.Add(rds);
       this.reportViewer1.RefreshReport();
    }
  </code></pre>
  
  <p>ReportForm's constructor</p>
  
  <pre><code>public ReportForm(DataGridView grid)
  {
       InitializeComponent();
       this.grid = grid;
  }
  </code></pre>
  
  <p>But I have an empty report.</p>