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

Get report ItemCollection and change their value

1 Answer 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
CHRISTODOULOS
Top achievements
Rank 1
CHRISTODOULOS asked on 26 Mar 2019, 01:48 PM

Hello,

We have a Win Forms project with a Telerik Report and at the same project we have a Form where we added the report viewer. What we want to do is to get the item collection of the Report to our main Form and change their values before we display the report at the viewer.

Thanks in advance for your time.

 

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 29 Mar 2019, 11:06 AM
Hello Christodoulos,

To alter dynamically report item properties, our recommendation is to use Conditional Formatting and Bindings. This approach allows achieving different layout of the report based on its data and report parameters, with all the necessary logic applied in the report definition through Expressions that are evaluated at run time.

We do not recommend changing the report definition run time. Still, in case, you need to modify the report at runtime (prior to displaying it in a viewer), you can instantiate and modify the report prior to setting the viewer's ReportSource and wrap it in an InstanceReportSource. For example in the Form_Load event. This approach is demonstrated in the How to: Bind to a DataSet article - check Form5_Load event handler. You can access the report items as explained here: Access Report Items Programmatically.

To be able to modify a TRDP report, you need to unpackage it first.

Best Regards,
Silviya
Progress 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
Tags
General Discussions
Asked by
CHRISTODOULOS
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or