Page 1 of 1

How to bind to datatable?

Posted: Tue Dec 23, 2008 11:38 pm
by Ray
Hello.
Currently I'm looking for good reporting system for .NET and decided to try Stimulsoft Report.
Now I have one question. How to bind my report to my DataTable.
Here is a code of simple application

Code: Select all

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        DataSet1.ViewOpersDataTable table = new DataSet1.ViewOpersDataTable();
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            table = viewOpersTableAdapter.GetData();
            viewOpersBindingSource.DataSource = table;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            stiReport1.Show(true);
        }
    }
}

as you can see I declared table and fill it in forms load event. Report already designed to use DataSet1.ViewOpers . But I can not use this
viewOpersTableAdapter.Fill(dataSet11.ViewOpers);
don't ask why :) I just need to know the way. How to assign my current table as datasource for my report. In our application we have a lot of MDI forsm so we can not use Fill method to fill data directly in DataSet. Each for must use its own datatable

How to bind to datatable?

Posted: Wed Dec 24, 2008 12:34 am
by Ray
Ok. Found a solution. Instead of binding to DataSet1.ViewOpers, I have to bind to viewOpersBindingSource at design time.
Thanks :)

How to bind to datatable?

Posted: Wed Dec 24, 2008 9:28 am
by Edward