This is a migrated thread and some comments may be shown as answers.

Using subreport binding to set ReportSource

2 Answers 258 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tracy
Top achievements
Rank 1
Tracy asked on 05 Jun 2015, 07:56 PM

I am using Telerik Report Designer, and I have a report that has many nested subreports. The report works fine, but I am trying to change one subreport based on user input.  I attempted to do this by adding a Binding to ReportSource like this:

 

= IIf(Parameters.Images.Value,"ShowImages.trdx", "NoImage.trdx")

When I run this I get the error

 

I've tried different variations of the Expression, including the full path of the trdx file,  but get the same error. Is there a way to change which file is referenced?

 

Thanks,

Tracy

2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 08 Jun 2015, 10:58 AM
Hello Tracy,

The SubReport.ReportSource Property expects a value of type ReportSource, not a string.
You have the following options to set the report based on the report parameter value:

  1. Use the SubReport.ReportSource expression without any bindings: screenshot.

  2. Bind the value of the ReportSource.Uri property to your expression.

  3. Create a User Function which returns a valid report source and bind the result to the ReportSource property.


Regards,
Nasko
Telerik
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? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Tracy
Top achievements
Rank 1
answered on 11 Jun 2015, 07:37 PM
Thanks, I'm not sure how I missed I could use an Expression in the report source but this now works exactly as I need it to.
Tags
General Discussions
Asked by
Tracy
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Tracy
Top achievements
Rank 1
Share this question
or