Adding data source in code and designer
Hello everyone. I am trying to pass complex sql query from my .net code.
I am registering datasource from code like this
report2.RegisterData(ds.Tables["Test"], "Test");
report2.GetDataSource("Test").Enabled = true;
//I am creating data source like this
TableDataSource table = new TableDataSource();
table = report2.GetDataSource("Test") as TableDataSource;
TableDataSource table = report2.FindObject("Table") as TableDataSource;
table.SelectCommand = "Here will be my complex query with procedures and so on. Resultant will be a table.";
//Creating a textbox in fastreport
TextObject text1 = report2.FindObject("Text1") as TextObject;
text1.Text = "[Test.docid]";
report2.Show();
My resultant table will return columns docid,etc.....
My problem is my report doesnt recognise [Test.docid]. My report is empty. It has only one Textobject i.e Text1 which is empty. I am not able to present data into the report. How should be the designer fast report file?
Thanks in Advance
I am registering datasource from code like this
report2.RegisterData(ds.Tables["Test"], "Test");
report2.GetDataSource("Test").Enabled = true;
//I am creating data source like this
TableDataSource table = new TableDataSource();
table = report2.GetDataSource("Test") as TableDataSource;
TableDataSource table = report2.FindObject("Table") as TableDataSource;
table.SelectCommand = "Here will be my complex query with procedures and so on. Resultant will be a table.";
//Creating a textbox in fastreport
TextObject text1 = report2.FindObject("Text1") as TextObject;
text1.Text = "[Test.docid]";
report2.Show();
My resultant table will return columns docid,etc.....
My problem is my report doesnt recognise [Test.docid]. My report is empty. It has only one Textobject i.e Text1 which is empty. I am not able to present data into the report. How should be the designer fast report file?
Thanks in Advance