Using a dynamically created object data source with SSRS
Posted on 2013-01-31
I am new to SSRS and am using a client-side report with a Winforms ReportViewer control.
I wish to allow the end user to define the report outside of my desktop application (not a problem) but also define how the values are calculated outside of the application. So what this means is I want to bind against an object whose properties are created at run time not at compile time.
I have tried using an object that derives from DynamicObject and using the TryGetMember method. This works fine when referencing properties from code, but does not work when trying to reference the properties using reflection. It fails with SSRS (presumably because it uses reflection?).
Is there a way to have my report reference properties that do not exist at compile time? Alternatively, is there a way to specify that the report should call a parameterised method on the object? Or is there some other approach?
Thanks in advance...