Solved

vb.net / Report rdlc ?

Posted on 2011-02-16
5
842 Views
Last Modified: 2012-05-11
using vb.net, and it seems the report viewer has changed. Now I create a new item, a Report.rdlc and I don't see how I can select a Datasource. Can someone tell me how to do this?
thanks
0
Comment
Question by:Jess31
5 Comments
 
LVL 7

Expert Comment

by:EYoung
ID: 34910695
When you add the ReportViewer control to your project, it will prompt you for the datasource.
0
 
LVL 1

Expert Comment

by:zxc3735
ID: 34914792
0
 
LVL 5

Expert Comment

by:puffdaddy411
ID: 34943537
Where is your data?  Do you use the Dataset designer and use tableadapters to pull in data?  OR...do you have code-generated tables in memory?
0
 

Author Comment

by:Jess31
ID: 34948703
I am trying with the Dataset Designer otherwise it seems to be very difficult to design the report.
0
 
LVL 5

Accepted Solution

by:
puffdaddy411 earned 500 total points
ID: 34953187
Ok.  You need to add a datasource to your localreport.  If you have custom tables generated in code, they can be used as well with a bit of trickery.  The following is for designer handled tables or query results.

ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("MyDataSet", Table))

I believe this line is what you need.
Dim DS As New MyDataSetTableAdapters.MyTableAdapter
        Dim Table As New MyDataSet.MyDataTable

        Table = DS.GetDataBy  'Or whatever your query method is named.


        Me.ReportViewer1.LocalReport.DataSources.Add(New Microsoft.Reporting.WinForms.ReportDataSource("MyDataSet", Table))

       'This is for locally saved reports.
        Me.ReportViewer1.LocalReport.ReportPath = YourPath & "Report1.rdlc"
        Me.ReportViewer1.RefreshReport()

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now