I want to programmatically access the fields collection in the ObjectDataSource object in either the OnItemDataBound or OnItemDataBinding event of the Telerik report to hide report elements if they do not contain values.
How would I accomplish this in the code file of the Telerik report?
1 Answer, 1 is accepted
0
Elian
Telerik team
answered on 09 Oct 2012, 09:03 AM
Hello Michael,
You cannot manually read the data from the ObjectDataSource itself but you can access the data objects of the processing items. For example you are listening for a Report_ItemDataBinding event:
var procRep = sender as Telerik.Reporting.Processing.Report;
var data = procRep.DataObject;
}
data will be the data which is bound to the report (which is your actual data-source).
If you listen to DetailSection_ItemDataBinding, then the DataObject will be just one row from the data-source.
It is not always needed to use event to hide items conditionally. If you explain in further detail what exactly is your scenario, we might give you an easier solution.
Regards,
Elian
the Telerik team
HAPPY WITH TELERIK 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!