Search code examples
devexpressparameter-passingdatasourcextrareport

XtraReport - get data from non-master datasource based on a parameter value


I want to get data from non-master datasource based on a parameter value.

Let's say we have 2 datasources in report: * datasource1 - main dataprovider * datasource2 - from which I need to get additional data

And also we have a report parameter, which is bound to the datasource2 to populate dropdown when report is opened.

I need that whenever user picks one of the option from parameter dropdown and submits, to grab corresponding item data from datasource2 and put in the report.

Is it possible? I didn't find any answer on the internet.


Solution

  • it will be possible if you leave single datasource but with two tables/datamembers, for example DevExpress SqlDataSource may have number of Queries, in the needed label you may write the expression

    iif(Parameters.UseDefault, OptionalTable.DefaultValue, DataTable.ValueColumn)

    is this helpful for your scenario?