I have a program that shows data in a datagridview. The data in the datagridview comes from a table in a dataset. The data looks good on the screen so I decided to add a way to print the data.
I created a new form, added a reportviewer control, and designed the report. I used my dataset as the datasource for the report.
I then added a button to my original form so that when it was pressed, it would show the form with the reportviewer control.
My problem is, when I hit the print button, it takes me to my reportviewer control form, but it shows my report with only the headings, no data. It’s like my dataset has no data in it! But, when I step through with debug, it shows over 1000 rows in my dataset.
So, my question is, what have I forgotten to do? The data is there, it shows up on one form (with the datagridview) but it doesn’t show up on the reportviewer control (only the headings).
There was really no coding involved. I just made a new form, added the reportviewer control, designed the report and told it to use my dataset as the datasource. Typically, this works for me. I can’t imagine why it’s not working.
Thanks for any help or advice!
Here’s the code that I use to show the report:
private void btnPrint_Click(object sender, EventArgs e)
{
Form showReport = new frmPrintView();
showReport.Show();
}
Here are images of my two screen. The data is obviously in my dataset, otherwise there would be none on the first screen. The second screen, though, seems to show my dataset as being empty since nothing appears but the headings.


I think you are missing the dataBind method:
From the Exam 70-516: TS: Accessing Data with Microsoft .NET Framework 4:
add it to the form load event on your form report