Data Regions, Containers, and Independent Report Items


Data Regions , Containers, and Independent Report Items

Report items (or presentation elements) in SSRS can be categorized as data regions (items that must be associated with data sets), containers (items that can contain other items), and independent report items. Some items can belong to more than one category.

Independent report items are items other than data regions. Textbox, Image, Line, Rectangle, and Subreport are independent report items. Independent report items do not have to be associated with any data sources.

Data regions function as a repetitive display of rows, groups of rows, or columns from a data set associated with a region. Table, Matrix, List, and Chart are data regions. In addition, data regions support grouping and sorting of displayed information. For more details of grouping and sorting, see Chapter 12, "Grouping, Sorting, and Aggregating Data, Working with Scope." All of the data regions, except Chart are also containers.

Containers, as the name implies, can contain any reporting items, including containers and data regions. Table, Matrix, List, Rectangle, Report Body, Page Header, and Page Footer are containers. Items placed in a container become the container's children and the container becomes the parent. As a result, the Parent property of each child item is populated with the name of a container. All children move together with the container when the container is moved. When the container is deleted, all children are deleted. The container is fixed when the position of a report item within this container is fixed. For example, a Table is a fixed container because the position of each cell is fixed. Most, but not all, of the containers are also data regions. Thus, data regions can be nested within other data regions.

Tip

If you delete a container by mistake, you can easily undo this action using the Edit, Undo menu or by using the Ctrl+Z keyboard shortcut. For the shortcut to work properly, the focus of the action should be the ReportName.rdl[Design] (Data or Layout tabs) or ReportName.rdl[XML] window.


From the perspective of RDL, the container has a <ReportItems> section, which is used to specify the beginning of a container for report items.

For example, Table 11.1 shows the RDL of a Rectangle that contains a single Line. The graphical presentation of this RDL is shown in Figure 11.1.

Table 11.1. Rectangle's RDL Explained

RDL Fragment

Explanation

 <Rectangle Name="rectangle1"> 

Opening RDL/XML tag indicating beginning of the Rectangle item.

 <Left>0.375in</Left> 

Left and Top Coordinates of the left end of an item.

 <Height>1in</Height><Top>0.25in</Top> <Width>2in</Width> 

Width and Height Relative position of the right end of an item. Height=0in or not included indicates horizontal line. Width=0in or not included indicates vertical line.

 <ZIndex>1</ZIndex> 

ZIndex Drawing order. In case of overlapping items, an item with a higher number covers an item with a lower number. ZIndex , Left , Top , Width , and Height are abbreviated as {POSITION} in the future discussion.

 <ReportItems> 

Beginning of a container for report items. To simplify further discussion, one or many items in the <ReportItems> section are abbreviated as {ITEMS} .

 <Line Name="line1"> 

Beginning of the line item.

 <Left>0.5in</Left>      <Top>0.25in</Top> <Width>1in</Width><Height>     0.5in</Height>     <ZIndex>1</ZIndex> 

{POSITION} see explanation above.Note: ZIndex numbering starts anew within each container. The ZIndex tag is not shown in the future RDL code samples unless attempting to pinpoint an explicit element of the style.

 <Style> 

Style Style of an item, such as color and width.

 <BorderColor> <Default>Blue</Default>         </BorderColor>         <BorderWidth>           <Default>5pt</Default>         </BorderWidth>         <BorderStyle> <Default>Solid</Default>         </BorderStyle>     </Style> 

More details on style are in Chapter 13,"Advanced Report Formatting." Report Designer inserts an empty tag, even if no style is specified. The style tag is not shown in the future RDL code samples unless attempting to pinpoint an explicit element of the style.

 </Line> 

Closing tag indicating the end of the Line item.

 </ReportItems> 

Closing tag indicating the end of the container.

 <Style>         <BorderStyle> <Default>Solid</Default>        </BorderStyle>     </Style> 

 
 </Rectangle> 

Closing tag indicating the end of the Rectangle item.


Figure 11.1. Line and Rectangle items.



Microsoft SQL Server 2005 Reporting Services
Microsoft SQL Server 2005 Reporting Services
ISBN: 0672327996
EAN: 2147483647
Year: 2004
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net