views:

387

answers:

1

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

A: 

If you are not using RDLC files, what is defining to the ReportViewer control what needs to be rendered on screen?

Jon
But when iam trying to add a datasource to the rdlc file. it shows no columms from the dataset iam using and the dataset requires parameters(stored procedur). Can i do something about it please help.
You can try to strongly type your datatables. The inside your dataset, you will have a strongly typed datatable that can be used in the RDLC file.
Jon