Solved

Help with viewing data in MS Report Viewer

Posted on 2012-03-21
10
1,072 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 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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
 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AJAX Create / Update Not working MVC 5 58
Best book for Internet security 4 48
Cannot interpret token '"' at position 10. 3 23
HIghlights of SSIS? 3 40
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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