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

Conditional display of subreport

1 Answer 431 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 22 Feb 2013, 04:59 PM
I'm sure this is described somewhere, but I'm having trouble solving this problem. I would like to have a subreport that displays based on the content of a field in the main report. If the field meets a certain condition, then pass a value to the subreport and it will do some code-behind to fill in its fields. So it would look something like this ..

Alabama is in the SEC
       Roll Tide
California is in the PAC 10
Michigan is in the BIG 10
Pennsylvania in the Ivy League
Tennessee is in the SEC
      Rocky Top
Notre Dame is Independent
Ohio State is in the Big 10
Kentucky is in the SEC
      Wildcats

... where only teams in the SEC display the "sub report" of additional information.

P.S. This is not exactly a master-detail relationship as the subreport data is drawn from a different source.
Thanks!

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 27 Feb 2013, 07:58 AM
Hello Keith,

This is a master-detail relationship with an addition of conditional visibility for the SubReport item. You can find attached sample reports (master and detail) which cover your scenario. The SubReport items in the master report are hidden conditionally with Bindings (in the concrete example every second SubReport is hidden). The Field value is passed to the SubReport with Report Parameter, which the detail report can use to retrieve and filter its data. 
 

Regards,
Elian
the Telerik team

See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

Tags
General Discussions
Asked by
Keith
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or