vant view dataset with microsoft report viewer

Posted by Tan on Stack Overflow See other posts from Stack Overflow or by Tan
Published on 2009-08-04T12:24:16Z Indexed on 2010/06/10 14:02 UTC
Read the original article Hit count: 548

Filed under:
|

I have a dataset, the dataset is using a stored procedur to fetch data. i have filled the dataset and everythings is okej.When iam using the debug i can se that the dataset is not empty. but i cant view it with the microsoft report viewer.

here is my code please help.

        private void frmPrint_Load(object sender, EventArgs e) {

        this.reportViewer1.RefreshReport();
        reportViewer1.LocalReport.DataSources.Clear();

        GetCauseMachineMatrixTableAdapter adapter = new GetCauseMachineMatrixTableAdapter();
        QpNibrolDataSet dataset = new QpNibrolDataSet();
        adapter.Fill(dataset.GetCauseMachineMatrix, this.start, this.end);

        DataTable DT = dataset.Tables[0];

        ReportDataSource reportdatasource = new ReportDataSource();
        reportdatasource.Name = "RDS_NAME";
        reportdatasource.Value = DT;


        reportViewer1.LocalReport.DataSources.Add(reportdatasource);
        reportViewer1.LocalReport.Refresh();
        reportViewer1.RefreshReport();

    }

the form is saying "The source of the report definition is not been specified" what im i doing wrong.

Idont use a rdlc because when iam trying to view my dataset no columms name show because the Stored procedur i am using requires Parameters. please advice and help my thank you

© Stack Overflow or respective owner

Related posts about c#

Related posts about reporting-services