Solved

vb.net / Report rdlc ?

Posted on 2011-02-16
5
852 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
 
LVL 1

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

729 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