Solved

vb.net / Report rdlc ?

Posted on 2011-02-16
5
836 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

17 Experts available now in Live!

Get 1:1 Help Now