467,886 Members | 1,794 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,886 developers. It's quick & easy.

Reportviewer Control - data not displaying

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.tbl 1)
RV1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
RV1.LocalReport.ReportPath = "C:\Code\TestProj\Report1.rdlc"
RV1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("tbl 1"))
RV1.LocalReport.ExecuteReportInCurrentAppDomain(Sy stem.Reflection.Assembly.GetExecutingAssembly().Ev idence)
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
Sep 15 '06 #1
  • viewed: 16893
Share:
1 Reply
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.

"Rich" wrote:
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.tbl 1)
RV1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
RV1.LocalReport.ReportPath = "C:\Code\TestProj\Report1.rdlc"
RV1.LocalReport.DataSources.Add(New
Microsoft.Reporting.WinForms.ReportDataSource("tbl 1"))
RV1.LocalReport.ExecuteReportInCurrentAppDomain(Sy stem.Reflection.Assembly.GetExecutingAssembly().Ev idence)
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
Sep 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by steve | last post: by
reply views Thread by Fred G. Sanford | last post: by
5 posts views Thread by =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post: by
1 post views Thread by gandhi.vishal | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.