Solved

Help with viewing data in MS Report Viewer

Posted on 2012-03-21
10
1,052 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
ID: 37750463
Which reporting tool do you use?

mlmcc
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37765235
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
ID: 37786805
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
ID: 37806599
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
ID: 37898155
Forums updated.

Added MS SSRS and Generic database reporting, removed Crystal Reports

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

 

Author Comment

by:vcharles
ID: 37909553
Help!
0
 

Author Comment

by:vcharles
ID: 37977042
Help!
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37977185
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
ID: 37977678
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
ID: 37978282
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

12 Experts available now in Live!

Get 1:1 Help Now