Reportviewer Control - data not displaying


G

Guest

Hello,

I am trying to use the Reportviewer control. I have been following an
example from the web, and the instructions from the help files on set up a
..rdlc and binding it to the reportviewer control. The help files state that
in the form the contains the reportviewer control there is a tasks smart tags
panel in design view. I don't see any such thing. Where do I need to look
to see this panel?

So I have been trying to follow an example on the web that sets up the
reportview control through code. I created the data soucrce (my .rdlc file)
which I named Report1 and planted the following code in the form load event.
When I execute the form, the reportviewer control shows some gif that says
"generating report". When it is done, I do not see my test data.

The data source is a plain table called "tbl1" which resides in a
sqlserver(2000) DB. The table contains 4 columns and about 6 rows of
data. I can see the data in visual studio designer when I preview the data
from the .rdlc. Here is the code:

Me.Tbl1TableAdapter.Fill(Me.Subscriber6DataSet.tbl1)
RV1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
RV1.LocalReport.ReportPath = "C:\Code\TestProj\Report1.rdlc"
RV1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("tbl1")
RV1.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence)
Me.RV1.RefreshReport()

Could someone tell me what I am missing or need to change? or could someone
tell me what the reportviewer control tasks smart tags panel is? Or where to
look for it?

Thanks,
Rich
 
Ad

Advertisements

G

Guest

I got it going. The key is to be able to read the instuctions. So here is
what I did (for posterity)

First I add a dataset from the Solution window - right click on the solution
title - goto Add - add the new dataset. Then I use the wizard in the
datasource tab of the solution window. Right -click on the new dataset I
just added and grab a table from the sqlserver DB. Now I have a typed
dataset with a datatable.

Next I add a Report to the project. From the solution window - solution
title - right click -goto Add - Add a new Report - which will be of type
..rdlc. In the report designer I drag a table from the toolbox onto the
Report canvas. Then, from the solution window/datasource tab, I expand the
dataset, expand the table and and drag each column of the datatable to the
desired detail cells in the table I just dragged into the Report canvas in
the Report designer. This automatically binds the dataTable columns to the
cells in the Report Table.

Next, I drag a reportviewer control to the form from the toolbox. The
control will have a dropdown asking what report to bind to. I select the
report I just added to the project. This will generate some autocode behind
the form in the Form_load event: It add this code:

'TODO: This line of code loads data into the 'DataSet1.tbl1' table. You can
move, or remove it, as needed.

Me.tbl1TableAdapter.Fill(Me.DataSet1.tbl1)

Me.RV1.RefreshReport()

Now I can see the data. Ideally, I would like to do this more dynamically
so I can report on data not stored on a disk, I guess that would be a list.
Well, at least I can now see some data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top