I'm using Telerik Reporting version 5.1.11.928. I bind the sql data source through the Telerik table wizard, then I called it from my code. Here is what my codes look like
private void MachineStatusReport_ItemDataBinding(object sender, EventArgs e)
{
uint pcGroupId = 0;
string sql = " // some sql query here..";
sqlDataSource1.SelectCommand = sql;
sqlDataSource1.Parameters.Clear();
sqlDataSource1.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] {
new Telerik.Reporting.SqlDataSourceParameter("ParameterDaysNumber", System.Data.DbType.Int32, ReportParameters["numDay"].Value),
new Telerik.Reporting.SqlDataSourceParameter("ParameterPcGroupID", System.Data.DbType.String, "= Parameters.pcGroupId.Value"),
new Telerik.Reporting.SqlDataSourceParameter("ParameterPcGroupLevel", System.Data.DbType.String, 0 < pcGroupId ? Common.GetPcGroupLevel(pcGroupId) + "-%" : "%")
});
DataSource = sqlDataSource1;
}
Next I bind the table to this datasource using ' = ReportItem.DataObject'. and created a group based on some fields from the sql.
It works fine. Now I need to add new table on the same report, selecting specific data from report datasource which I have been using above and using the same grouping. However I cant use the same datasource result as I need to do another select statement to get the data from sqlDataSource1 result. So how should I go about it.?
private void MachineStatusReport_ItemDataBinding(object sender, EventArgs e)
{
uint pcGroupId = 0;
string sql = " // some sql query here..";
sqlDataSource1.SelectCommand = sql;
sqlDataSource1.Parameters.Clear();
sqlDataSource1.Parameters.AddRange(new Telerik.Reporting.SqlDataSourceParameter[] {
new Telerik.Reporting.SqlDataSourceParameter("ParameterDaysNumber", System.Data.DbType.Int32, ReportParameters["numDay"].Value),
new Telerik.Reporting.SqlDataSourceParameter("ParameterPcGroupID", System.Data.DbType.String, "= Parameters.pcGroupId.Value"),
new Telerik.Reporting.SqlDataSourceParameter("ParameterPcGroupLevel", System.Data.DbType.String, 0 < pcGroupId ? Common.GetPcGroupLevel(pcGroupId) + "-%" : "%")
});
DataSource = sqlDataSource1;
}
Next I bind the table to this datasource using ' = ReportItem.DataObject'. and created a group based on some fields from the sql.
It works fine. Now I need to add new table on the same report, selecting specific data from report datasource which I have been using above and using the same grouping. However I cant use the same datasource result as I need to do another select statement to get the data from sqlDataSource1 result. So how should I go about it.?