Page 1 of 1

Nested lists

Posted: Tue Dec 02, 2008 11:59 am
by Tobias Grimm
Having a business object like this:

Code: Select all

var reportData = new ArrayList
{
    new ArrayList
    {
        new BarDto {BarProperty = "Bar Dto #1"},
        new BarDto {BarProperty = "Bar Dto #2"},
    },
    new ArrayList
    {
        new FooDto {FooProperty = "Foo Dto #1"},
        new FooDto {FooProperty = "Foo Dto #2"},
    }
};
...Reports.Net somehow joins the two child lists into a singe data source:

Code: Select all

BarProperty FooProperty
-----------------------
Bar Dto #1  NULL
Bar Dto #2  NULL
NULL        Foo Dto #1
NULL        Foo Dto #2
Is there a way to make those two lists be mapped as separate data sources?

(I think I haven't completely wrapped my mind yet around the way the bussiness object to data source mapping works.)

Nested lists

Posted: Thu Dec 04, 2008 5:51 am
by Tobias
Forget about this issue. I've found a better way to be completely flexible in dynamically building my report data.

With some ICustomTypeDescriptor magic, I can now simply add "sub reports" as new properties to the parent report, which makes a much easier to use data source model. Works like a charm with Reports.Net!

Nested lists

Posted: Thu Dec 04, 2008 6:38 am
by Edward
Hello Tobias.

Thank you for this information and for your good words!

Thank you.