If I understood correctly, the requirement is to design report, which SqlDataSource(s) would have different number of data fields based on some condition.
In Telerik Reporting it is assumed that the data schema is known in design time. We recommend the query to always return the same data fields/columns. This way the data fields would be accessible design time and reports could be easily created with our designers, i.e. without additional code. One workaround I could offer would be to modify the SQL query to always return the same (i.e. all possible) data columns. If a particular data column is not desired, the data records it would contain could be set to some constant value of the corresponding type that is meaningless in the context of the report. In the Report the report item displaying this data field could be hidden when its value is equal to this meaningless constant with Conditional Formatting or Bindings.
If the above approach is not applicable, then it would be necessary to create the report programmatically. I could suggest you to look in the automatically generated InitializeComponent method of the Report class when Visual Studio designer is used. All code generating the Report definition is there, and could be an excellent guide to creating/modifying a Telerik Reporting Report programmatically.
For your convenience there is a sample project attached that dynamically modifies a Table based on the fields of the provided CsvDataSource. The two CsvDataSources mimic two possible states of an SqlDataSource fed by a SQL query with different data fields based on some condition. I could suggest you to change the data source by assigning it either the value returned by GetFirstDataSource, or by GetSecondDataSource method to view the effect on the generated Table. Note that in design time the Table has a single column (that is supposed to be always present), and the rest of the columns are generated dynamically by the FormatTableBasedOnDataSource method.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items