How to bind to datatable?

Stimulsoft Reports.NET discussion
Post Reply
Ray
Posts: 2
Joined: Tue Dec 23, 2008 11:32 pm

How to bind to datatable?

Post 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
Ray
Posts: 2
Joined: Tue Dec 23, 2008 11:32 pm

How to bind to datatable?

Post by Ray »

Ok. Found a solution. Instead of binding to DataSet1.ViewOpers, I have to bind to viewOpersBindingSource at design time.
Thanks :)
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to bind to datatable?

Post by Edward »

Post Reply