Could be an understanding problem, but I cannot report business objects from collections:
Here is a sample of business object:
Code: Select all
public class ProductProfile
{
public string Name { get; set; }
public string Id { get; set; }
public ProductStatic Static { get; private set; }
public ProductProfile()
{
Static = new ProductStatic();
}
}
public class ProductStatic
{
public string StaticField { get; set; }
public string StaticField2 { get; set; }
public double? Numeric { get; set; }
public ProductAllocations Allocations { get; private set; }
public ProductStatic()
{
Allocations = new ProductAllocations(new ProductAllocation { Name = "test 1", Result = "value 1" }, new ProductAllocation { Name = "test 2", Result = "value 2" });
}
}
public class ProductAllocations : IEnumerable
{
List _items;
public ProductAllocations(params ProductAllocation[] items)
{
_items = new List(items);
}
public IEnumerator GetEnumerator()
{
return _items.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return _items.GetEnumerator();
}
}
public class ProductAllocation : ProductBase
{
public string Name { get; set; }
public string Result { get; set; }
}
Code: Select all
var p = new ProductProfile
{
Name = "Test Product",
Id = "122",
Static =
{
Numeric = 12,
StaticField = "Field 1",
StaticField2 = "Field 2"
}
};
report.RegBusinessObject("Data", "Product", p);
Please find attached demo app, just drag & drop Product.Static.Allocations to design surface and hit preview.
The data is definitely available. But nothing is reported.