Solved

Using a dynamically created object data source with SSRS

Posted on 2013-01-31
4
417 Views
Last Modified: 2013-03-02
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...
0
Comment
Question by:Seiker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 38840448
"I want to bind against an object whose properties are created at run time not at compile time." - you can't use SSRS (shared or not) dynamically created Data source as far as I'm aware.
0
 

Author Comment

by:Seiker
ID: 38850291
So if I want to fully define the report outside of my application code and have it bind to object properties (or methods?) that are not defined at compile time (i.e. defined dynamically or outside of my application code), what are my options?

What I am trying to avoid is building a custom application for each of our customers or needing to modify our application each time they want to add a new value or change they way they want to calculate an existing value.
0
 

Accepted Solution

by:
Seiker earned 0 total points
ID: 38925103
I have gone for a solution that automatically generates code which is then imported at runtime using MEF. This is more effort than originally planned but gives me the desired ability to create the properties outside of the built application.

Thanks for your help.
0
 

Author Closing Comment

by:Seiker
ID: 38944795
No other solution was provided.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: This article is aimed at report developers who are used to developing reports using relational databases and have gotten a first-time assignment to develop reports on OLAP cubes. It demonstrates how to build a report using SQL Ser…
Introduction As you'll probably know, a data region in a SQL Server Reporting Services report can be linked to only one dataset.  This makes it troublesome when you need to display data from more than one dataset in the same data region.  SQL Serve…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question