Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1110
  • Last Modified:

Help with viewing data in MS Report Viewer

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
vcharles
Asked:
vcharles
  • 5
  • 3
  • 2
1 Solution
 
mlmccCommented:
Which reporting tool do you use?

mlmcc
0
 
CodeCruiserCommented:
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
 
vcharlesAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
vcharlesAuthor Commented:
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
 
mlmccCommented:
Forums updated.

Added MS SSRS and Generic database reporting, removed Crystal Reports

mlmcc
Zone Advisor
0
 
vcharlesAuthor Commented:
Help!
0
 
vcharlesAuthor Commented:
Help!
0
 
mlmccCommented:
Click the REQUEST ATTENTION link under the question and explain what you need.

mlmcc
0
 
CodeCruiserCommented:
You have to update your references(remove and add again)

http://connect.microsoft.com/VisualStudio/feedback/details/607566/reportviewer-error
0
 
vcharlesAuthor Commented:
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now