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

Use ReportParameter as global variable

1 Answer 416 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 08 Jan 2013, 03:34 PM
Is it possible to change a ReportParameter within the NeedsDataSource event so that it can be used as a global variable.

I'm maintaining some stupid code and it has the same ugly check on the majority of the TableGroup Filters and what I would like to do is simply set a ReportParamerter at runtime so that value can be reused in an Expression or passed to UserFunctions.


/* Ugly and long check here */

becomes

= Parameters.ShowLeftCol.Value = =True


I can update the ReportParameter value, but the instance of it within the rendering engine is not updated.    Any suggestions

The logic to show the Column resides in configuration data within a different datasource then the one bound to the table.

Any ideas or suggestions would be most appreciative.
Thanks   

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Jan 2013, 03:23 PM
Hello,

Our suggestion is to add a public method or property. Generally you can access report properties or methods in expression as shown in the following example:
= ReportItem.Report.ItemDefinition.MyFunction(args)

Greetings,
Peter
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

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