?
Solved

Help with viewing data in MS Report Viewer

Posted on 2012-03-21
10
Medium Priority
?
1,087 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
[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
  • 3
  • 2
10 Comments
 
LVL 101

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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 101

Expert Comment

by:mlmcc
ID: 37898155
Forums updated.

Added MS SSRS and Generic database reporting, removed Crystal Reports

mlmcc
Zone Advisor
0
 

Author Comment

by:vcharles
ID: 37909553
Help!
0
 

Author Comment

by:vcharles
ID: 37977042
Help!
0
 
LVL 101

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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

801 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