Hi,
I'm building a PDF report which has two groups and a detail. I use a custom entity for report data source. However, this entity contains a nested collection. I want to group the outermost group on the "ID" values that are contained in the nested entity collection.
So, my entity looks like:
class ReportEntity
{
...
...
public List<NestedEntity> Nested { get; set; }
...
...
}
For my report, I set,
ReportEntity repData = .... // Get data from database
Report.DataSource = repData
Now, in designer, I right click on Report, go to "Groups" and create an expression for a group that I've added there. The expression looks like:
=Fields.Nested.ID // Assume ID is a member for NestedEntity class
It throws exception saying "ID" is no defined in current context. I then tried using ObjectDataSource, go to data explorer and drag and drop fields from the data explorer. The expression that designer generated was:
=Fields.Nested.Items.ID
However, when I run the report, I get the exception saying "Items" is not defined in current context.
This issue has been bugging me for a while. While I can assign a collection of NestedEntity directly as Report's data source but I would not prefer to do that. It makes certain other things complex for me given the complexity of the report and data structure.
How can I achieve grouping in this scenario?
[P.S.] I am using Q2 2010
I'm building a PDF report which has two groups and a detail. I use a custom entity for report data source. However, this entity contains a nested collection. I want to group the outermost group on the "ID" values that are contained in the nested entity collection.
So, my entity looks like:
class ReportEntity
{
...
...
public List<NestedEntity> Nested { get; set; }
...
...
}
For my report, I set,
ReportEntity repData = .... // Get data from database
Report.DataSource = repData
Now, in designer, I right click on Report, go to "Groups" and create an expression for a group that I've added there. The expression looks like:
=Fields.Nested.ID // Assume ID is a member for NestedEntity class
It throws exception saying "ID" is no defined in current context. I then tried using ObjectDataSource, go to data explorer and drag and drop fields from the data explorer. The expression that designer generated was:
=Fields.Nested.Items.ID
However, when I run the report, I get the exception saying "Items" is not defined in current context.
This issue has been bugging me for a while. While I can assign a collection of NestedEntity directly as Report's data source but I would not prefer to do that. It makes certain other things complex for me given the complexity of the report and data structure.
How can I achieve grouping in this scenario?
[P.S.] I am using Q2 2010