none
A data source instance has not been supplied for the data source RRS feed

  • Question

  • Can some clever person pls help me out of this dilemma, I have tried everything for two days now and cant get past this error:

     

    I have developed one VS Report and is able to view it successfully, but now I have created a second one and I get the error

     

    A data source instance has not been supplied for the data source "ManifestDS_ManifestTable" when I run the report

     

    I have tried to make a seperate Dataset with its own table in stead of just adding a second table to the existing Dataset but it doesnt seem to help. I have deleted and again added the "ManifestDS_ManifestTable" Datasource in the Report-> DataSources Window in the VS2005 Menus and it is there. It just seems like VS doesnt recognize this second datasource "ManifestDS_ManifestTable" following is some of my code: (any help will be appreciated Thank you)

     

    BEGIN OF MY CODE SAMPLE

    private void InitializeComponent()

    {

    this.components = new System.ComponentModel.Container();

    Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new Microsoft.Reporting.WinForms.ReportDataSource();

    this.ManifestTableBindingSource = new System.Windows.Forms.BindingSource(this.components);

    this.ManifestDS = new FMSTyco.ManifestDS();

    this.rvManifest = new Microsoft.Reporting.WinForms.ReportViewer();

    ((System.ComponentModel.ISupportInitialize)(this.ManifestTableBindingSource)).BeginInit();

    ((System.ComponentModel.ISupportInitialize)(this.ManifestDS)).BeginInit();

    this.SuspendLayout();

    //

    // ManifestTableBindingSource

    //

    this.ManifestTableBindingSource.DataMember = "ManifestTable";

    this.ManifestTableBindingSource.DataSource = this.ManifestDS;

    //

    // ManifestDS

    //

    this.ManifestDS.DataSetName = "ManifestDS";

    this.ManifestDS.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;

    //

    // rvManifest

    //

    this.rvManifest.Dock = System.Windows.Forms.DockStyle.Fill;

    reportDataSource1.Name = "ManifestDS_ManifestTable";

    reportDataSource1.Value = this.ManifestTableBindingSource;

    this.rvManifest.LocalReport.DataSources.Add(reportDataSource1);

    this.rvManifest.LocalReport.ReportEmbeddedResource = "FMSTyco.RepManifest.rdlc";

    this.rvManifest.Location = new System.Drawing.Point(0, 0);

    this.rvManifest.Name = "rvManifest";

    this.rvManifest.Size = new System.Drawing.Size(1013, 558);

    this.rvManifest.TabIndex = 0;

    //

    // frmManifest

    //

    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

    this.ClientSize = new System.Drawing.Size(1013, 558);

    this.Controls.Add(this.rvManifest);

    this.Name = "frmManifest";

    this.Text = "frmManifest";

    this.Load += new System.EventHandler(this.frmManifest_Load);

    ((System.ComponentModel.ISupportInitialize)(this.ManifestTableBindingSource)).EndInit();

    ((System.ComponentModel.ISupportInitialize)(this.ManifestDS)).EndInit();

    this.ResumeLayout(false);

    END OF MY CODE SAMPLE

    Friday, September 21, 2007 9:28 PM

Answers

  • I found the following Code that I used that fixed my problem, maybe it can be helpfull to somebody else:

     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Text;

    using System.Windows.Forms;

    using System.Data.SqlClient;

    using Microsoft.Reporting.WinForms;

    namespace CBRVTEST

    {

    public partial class Form1 : Form

    {

    TycoWS.Service WS;

    public Form1()

    {

    InitializeComponent();

    }

    private void Form1_Load(object sender, EventArgs e)

    {

     

    try

    {

    WS = new MyWS.Service(); //A webService

    DataSet d1 = WS.tstProducts();

     

    ReportViewer1.LocalReport.ReportEmbeddedResource = "CBRVTEST.rptProductList.rdlc";

    ReportDataSource rds = new ReportDataSource();

    rds.Name = "dsProduct_dtProductList";

    rds.Value = d1.Tables[0];

    ReportViewer1.LocalReport.DataSources.Add(rds);

    //load report viewer

    ReportViewer1.RefreshReport();

    }

    catch (Exception ex)

    {

    //display generic error message back to user

    MessageBox.Show(ex.Message);

    }

     

     

     

     

     

    }

    }

    }

     

    Saturday, September 22, 2007 9:59 PM

All replies

  • I found the following Code that I used that fixed my problem, maybe it can be helpfull to somebody else:

     

    using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Text;

    using System.Windows.Forms;

    using System.Data.SqlClient;

    using Microsoft.Reporting.WinForms;

    namespace CBRVTEST

    {

    public partial class Form1 : Form

    {

    TycoWS.Service WS;

    public Form1()

    {

    InitializeComponent();

    }

    private void Form1_Load(object sender, EventArgs e)

    {

     

    try

    {

    WS = new MyWS.Service(); //A webService

    DataSet d1 = WS.tstProducts();

     

    ReportViewer1.LocalReport.ReportEmbeddedResource = "CBRVTEST.rptProductList.rdlc";

    ReportDataSource rds = new ReportDataSource();

    rds.Name = "dsProduct_dtProductList";

    rds.Value = d1.Tables[0];

    ReportViewer1.LocalReport.DataSources.Add(rds);

    //load report viewer

    ReportViewer1.RefreshReport();

    }

    catch (Exception ex)

    {

    //display generic error message back to user

    MessageBox.Show(ex.Message);

    }

     

     

     

     

     

    }

    }

    }

     

    Saturday, September 22, 2007 9:59 PM
  • I'm too lazy and tired just now to plow through your code, however...

     

    Once you have code added to your host forms' *.designer.cs file and/or specify a dataset in the RDLC file by using the wizards/menus/quick-tasks etc...

     

    The wizards (etc) will NOT go back and remove the generated code constructs even if you delete the dataset or remove references to the Tables etc.

     

    Then what you end up with is dangling extra code that although it may build and is not obvious, at some point the sum of that leftover generated code becomes toxic at runtime or causes a meltdown of the project.

     

    Those are rather imprecise terms and again I'm tired and short on time and all, but in a big-picture view that's been my experience... Because the wizards etc don't remove generated code when the original constructs are removed, at some point one achieves a critical mass of that leftover generated code and it becomes toxic.

     

    Wednesday, September 26, 2007 2:28 AM