Layout Portion of the List Report Sample
The layout portion of the report defines how the data
appears in the report.
The following is the XML for the layout portion of the list report sample.
<report xmlns="http://developer.cognos.com/schemas/report/7.0/"
expressionLocale="en-us">
<modelPath>/content/package[@name='GO Sales and Retailers']
/model[@name='model']</modelPath>
<queries>
...
</queries>
<layouts>
<layout>
<reportPages>
<page name="Page1">
<pageBody>
<contents>
<list name="List1" refQuery="Query1">
<style>
<CSS value="border-collapse:collapse"/>
<defaultStyles>
<defaultStyle refStyle="ls"/>
</defaultStyles>
</style>
<listColumns>
<listColumn>
<listColumnTitle>
<contents>
<textItem>
<dataSource>
<dataItemLabel refDataItem="Product name"/>
</dataSource>
</textItem>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="lt"/>
</defaultStyles>
</style>
</listColumnTitle>
<listColumnBody>
<contents>
<textItem>
<dataSource>
<dataItemValue refDataItem="Product name"/>
</dataSource>
</textItem>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="lc"/>
</defaultStyles>
</style>
</listColumnBody>
</listColumn>
<listColumn>
<listColumnTitle>
<contents>
<textItem>
<dataSource>
<dataItemLabel refDataItem="Quantity"/>
</dataSource>
</textItem>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="lt"/>
</defaultStyles>
</style>
</listColumnTitle>
<listColumnBody>
<contents>
<textItem>
<dataSource>
<dataItemValue refDataItem="Quantity"/>
</dataSource>
</textItem>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="lm"/>
</defaultStyles>
</style>
</listColumnBody>
</listColumn>
</listColumns>
</list>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="pb"/>
</defaultStyles>
</style>
</pageBody>
<style>
<defaultStyles>
<defaultStyle refStyle="pg"/>
</defaultStyles>
</style>
</page>
</reportPages>
</layout>
</layouts>
</report>
Notes About the Layout Elements in a List Report
- The
listelement defines the appearance of the list in the report.Add the
refQueryattribute to thelistelement to identify the query that contains the data items that you reference in the list. The value of therefQueryattribute must match the value of thenameattribute of thequeryelement. - The
listColumnelement defines a column in the list. Each column contains a title and a body represented by thelistColumnTitleandlistColumnBodyelements. - The
contentselement defines the contents of a number of layout elements. - The
textItemelement defines text in a report. For example, in this sample, this element is used in thelistColumnBodyandlistColumnTitleelements. - The
dataSourceelement defines the source for the text in thetextItemelement. ThedataSourceelement can have adataItemValueor adataItemLabelchild element.If you use the
dataItemValueelement, the text item contains values from the column of data represented by the data item. If you use thedataItemLabelelement, the text item contains the label of the data item.The value of the
refDataItemattribute must match the value of thenameattribute of adataItemelement from the query.