JMarsch
JMarsch

Reputation: 21751

Microsoft Reporting and Complex Objects

We are considering building a custom data processing extension for Microsoft Reporting Services in order to allow us to report directly off of our data objects.

My question: Suppose I have an object that represents the row, but it has a member that is a complex object:


public class TheRowObject
{
  // a "normal" field
  public string Name {get; set;}

  // a complex field object
  public Address BillingAddress { get; set;}
}

public class Address
{
  public string City {get; set;}
  public string State {get; set;}
  public string Zip {get; set}
}

I have no trouble putting TheRow.Name on the report, but what if I want to put TheRow.BillingAddress.City?

The report designer lets me drag BillingAddress onto the report surface, but at runtime, it displays the text "Error" in the field.

Is there a way to display members of complex objects?

EDIT What I'm really after, if it's possible, is for the end user to be able to drag properties of the complex object from the ReportData tool window right onto the report surface. I was hoping that there is some kind of built-in ability to do this in the report viewer.

If there is not a built-in way to handle that, I'm guessing I will need to either provide custom formulas within the report, or provide a data extension that "flattens" the properties of the complex object, so that they look like ordinary fields.

Upvotes: 2

Views: 1063

Answers (2)

JMarsch
JMarsch

Reputation: 21751

It looks as though the short answer to this one was "no". I appreciate the responses, but it appears that reporting services expects simple data types as columns. If anyone learns something different, I'd love to hear about it.

Upvotes: 2

jason saldo
jason saldo

Reputation: 9960

What if you edit the RDL or formula in free text. For example change TheRow.BillingAddress to TheRow.BillingAddress.City.

Upvotes: 0

Related Questions