troubleshooting Question

Datasource for Report Viewer error when loading report

Avatar of zipnotic
zipnoticFlag for United States of America asked on
.NET ProgrammingVisual Basic.NET
5 Comments1 Solution1332 ViewsLast Modified:

Using VS2008 vb I'm trying to manually load the datasource for a report with the following code:

 cmd.Connection = sql
            cmd.CommandType = System.Data.CommandType.Text
            cmd.CommandText = "SELECT dbo.v_Incident.*, dbo.v_IComment.* FROM dbo.v_IComment INNER JOIN dbo.v_Incident ON dbo.v_IComment.Incident_FK = dbo.v_Incident.Incident_PK WHERE (dbo.v_Incident.Incident_PK = " + assigned + ")"

                If sql.State <> ConnectionState.Open Then sql.Open()
                da.SelectCommand = cmd
                ' da.Fill(ds, "v_Incident")
            Catch ex As Exception
                MsgBox("Error Connecting to database.", MsgBoxStyle.Critical, "Error Alert!")

            End Try

            ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
            Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Search.Report3.rdlc"
            ReportDataSource1.Name = "v_Incident"
            ReportDataSource1.Value = ds.Tables("v_Incident")

The Form with the report viewer "ReportViewer" loads but displays a grayed out error where the report should be:
A data source instance has not been supplied for the data source 'ReportEvent_v_Incident'.

As a note I had this working with the built in dataset generator and then took it out to do it manually.  I've been putzing around with the code for hours now so things may have gotten really messed up now.
 Any Ideas?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros