List is designed to present data in a free-form fashion for complex repeating areas. List repeats items for each row of the associated data set. List allows you to group and sort rows of data. A single list can have only a single group, but lists can be nested within each other to provide multiple grouping. A list or, more precisely, a nested set of lists has the same overall capabilities as a table. Examples TableDemo and ListDemo that are included in the samples for this book demonstrate how both a table and a list can produce the identical rendered result. However, Table report item has better performance and you should almost always choose a table when possible. In some cases, report developers might find List to be very useful for complex formatting. In such cases, using a table might no longer provide an elegant solution. One of the examples in which List can be used is check printing. List allows you to position items in a free-form fashion and allows for an elegant design. List is described with the following RDL. This RDL contains an optional group expression: =Fields!SalesOrderNumber.Value <List Name="list1"> {POSITION} {ITEMS} <DataSetName>DataSet1</DataSetName> <Style /> <Grouping Name="list1_Details_Group"> <GroupExpressions> <GroupExpression> =Fields!SalesOrderNumber.Value</GroupExpression> </GroupExpressions> </Grouping> </List> An example of a list is shown in Figure 11.6. Figure 11.6. Design-time picture of a list.When deciding whether to use Rectangle or List as a container for other nonrepetitive controls, you should consider the number of data sets defined for a report. If there are multiple data sets, List can provide a better choice from a perspective of scope resolution for a Fields collection. In this case, all the controls contained in a List can benefit from the DataSetName property of a List. This allows you to use a simplified expression, such as =Fields!Name.Value as opposed to an expression with specified scope resolution, such as =First(Fields!Name.Value, "DatasetName"). Scope resolution will be required for an expression contained within a Rectangle. |