How to pass the data source from parent report to sub-reports and to use data in the data source to build multi select parameters

1 Answer 559 Views
General Discussions
Brendan
Top achievements
Rank 1
Brendan asked on 11 Aug 2021, 06:02 AM
I have a parent report with 
inline CSV1 
Descr Value
Verified 1
Not-Verified 0

inline CSV2
Descr value
ChartView 0
GridView 1

Report Parameters
Id supplied to report
Verified visible selected from inline CSV1
View visible selected from inline CSV2
Months visible multi-selected from Distinct list of 'FormattedDate' in 'dsMain'
Statuses visible multi-selected from Distinct list of 'Status' in 'dsMain'


I have a stored proc taking params 'Id' and 'Verified' from parent report to populate 'dsMain' datasource.
Stored proc to be called only when 'Id' or 'Verified' change and returning data including.... 
Id
Verified
Date(01-mm-yyyy) 
FormattedDate(MMM yy)
Status (S1,S2,S3,S4,S5)
DataItem1
DataItem2
DataItem3
DataItem4
DataItem5.... etc

I have a sub-report 'Chart' displaying a clustered vertical barchart
'Chart' sub-report is only visible if 'View' parameter of parent report is value of ChartView(0)
'Chart' sub-report to use 'dsMain' from parent report and filtering on 'Months' and 'Statuses' and sorting by 'Date'
'Chart' is grouped on 'FormattedDate' and each series is derived for each value in 'Status', value is Count('Status')

I have a sub-report 'Grid' displaying a datagrid
'Grid' sub-report is only visible if 'View' parameter of parent report is value of GridView(1)
'Grid' sub-report to use 'dsMain' from parent report and filtering on 'Months' and 'Statuses' and sorting by 'Date'

I cannot work out how to access the data source 'dsMain' from the sub-reports.
I cannot work out how to stop the stored proc from being called whenever 'View', 'Months' or 'Status' gets changed by the user.
The key issue here is the cost of running the Stored Proc when it has all the necessary data to filter and populate the controls on either of the sub reports.
The only time the data source should be refreshed is if the 'Id' or 'Verified' parameters of the parent report is changed.

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 13 Aug 2021, 12:06 PM

Hello Brendan,

I would recommend checking the following articles:

- How to bind Sub Report to Main Report's Data

- How To Programmatically Create a Master-Detail Report Using SubReport Item

For the Id and Verified parameters, you may test to set the AutoRefresh property to True.

Regards,
Neli
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
General Discussions
Asked by
Brendan
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or