Solved

Help with viewing data in MS Report Viewer

Posted on 2012-03-21
10
1,050 Views
Last Modified: 2012-06-27
Hello,

I am able to see the data when connecting the datasource to a grid, however when trying the same with the MS ReportViewer control, no data is displayed, but the following message is displayed, "The source of the report definition has not been specified"

How do I fix this problem?  

 Dim bsr As New BindingSource()
        bsr.DataSource = dt
        'dt.WriteXml(" D:\XMLoutput.xml") - Use this trick to create XML to design report
        Dim reportDataSource As New Microsoft.Reporting.WinForms.ReportDataSource()
        reportDataSource.Name = "Testingreport"
        reportDataSource.Value = dt
        ReportViewer1.LocalReport.DataSources.Add(reportDataSource)
        ReportViewer1.LocalReport.Refresh()
        ReportViewer1.RefreshReport()



Similar Code working with Grid:

 Dim bs As New BindingSource()
        bs.DataSource = dt
        C1TrueDBGrid1.DataSource = bs
        Dim FilteredDT As DataTable
        Dim DV As New DataView(dt, SearchCriteria, Nothing, DataViewRowState.CurrentRows)
        FilteredDT = DV.ToTable
        C1TrueDBGrid1.DataSource = FilteredDT

Thanks,

Victor
0
Comment
Question by:vcharles
  • 5
  • 3
  • 2
10 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Which reporting tool do you use?

mlmcc
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Do you load the report before adding the datasource to the viewer?

Why have you declared and initialized bsr if you are not going to use it?
0
 

Author Comment

by:vcharles
Comment Utility
I'm sorry for the late reply.

The report was initially created using VS 2008 and all was working well, now when I convert it to VS2010. I receive the following error:

Could not load file or assembly 'Microsoft.ReportDesigner, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The variable 'ReportViewer2' is either undeclared or was never assigned.

How do I fix these two errors?

Victor
0
 

Author Comment

by:vcharles
Comment Utility
Help! I still can't figure out why the report doesn't work after  converting the project to VS2010? Any ideas on how to fix this problem?
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Forums updated.

Added MS SSRS and Generic database reporting, removed Crystal Reports

mlmcc
Zone Advisor
0
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!

 

Author Comment

by:vcharles
Comment Utility
Help!
0
 

Author Comment

by:vcharles
Comment Utility
Help!
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Click the REQUEST ATTENTION link under the question and explain what you need.

mlmcc
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
You have to update your references(remove and add again)

http://connect.microsoft.com/VisualStudio/feedback/details/607566/reportviewer-error
0
 

Author Comment

by:vcharles
Comment Utility
Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Open a folder with partial name 14 27
VB.Net - For Loop Error 5 23
Loop through Multiple Processes Async 2 15
XML & .net 5 16
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

16 Experts available now in Live!

Get 1:1 Help Now