ConnectionString
etedali
Isfahan
Hi,
I have a report prepared, at all stages of construction have done it with the wizard.
But the software on any database system to address differents Connection, I have a ConnectionString in my program files to load before I Report to FastReport for work I wrote the following code:
But it shows only the first row data in my database? What do I do for solving this problem?
I need a code for a place exactly the part of the wizard ,that I double click on "Data band" and DataSource selection!
I have a report prepared, at all stages of construction have done it with the wizard.
But the software on any database system to address differents Connection, I have a ConnectionString in my program files to load before I Report to FastReport for work I wrote the following code:
private void button1_Click(object sender, EventArgs e)
        {
            using (Report rpt = new Report())
            {
                rpt.Load("ReportTest.frx");
                rpt.RegisterData(Person.GetPersonMember(), "Person");
                rpt.GetDataSource("Person").Enabled = true;
                rpt.SetParameterValue("MyParameter", DbConnection.ConnectionString);
                rpt.Show();
            }
        }
But it shows only the first row data in my database? What do I do for solving this problem?
I need a code for a place exactly the part of the wizard ,that I double click on "Data band" and DataSource selection!
Comments
Looks like your databand is not connected to a datasource. You may do it in code:
...
rpt.GetDataSource("Person").Enabled = true;
(rpt.FindObject("Data1") as DataBand).DataSource = rpt.GetDataSource("Person");
...
My problem was solved.