Hi,
I have a requirement in a list report, how to create alternate rows as blank(without breaking the data)..
Please, i need your help.....
thanks in adv.
The example I'm giving is based on a list with two attributes, year and month, but it will scale up nicely.
- Add your data items to the list
- Click on the list Grouping & Sorting
- Add each attribute to the groups and click ok
- Click on structure --> List Headers & Footers --> Month (header)
- Click on the cell that is created: structure --> Insert List Row Cells Above --> 1 --> OK
- Delete the cell that is still selected
- format the blank cell as you please (I added a text item with a single space)
This will result in a blank row above each row.
The following example is using 8.2 on the GO Sales model
<report xmlns="http://developer.cognos.com/schemas/report/3.0/" expressionLocale="he"><!--RS:8.2-->
<modelPath>/content/package[@name='GO Sales']/model[@name='model']</modelPath>
<queries>
<query name="Query1">
<source>
<model/>
</source>
<selection><dataItem name="Year" aggregate="none"><expression>[Sales].[Time].[Time].[Year]</expression></dataItem><dataItem name="Month" aggregate="none"><expression>[Sales].[Time].[Time].[Month]</expression></dataItem></selection>
</query>
</queries>
<layouts>
<layout>
<reportPages>
<page class="pg" name="Page1">
<pageBody class="pb">
<contents>
<list class="ls" refQuery="Query1">
<style>
<CSS value="border-collapse:collapse"/>
</style>
<listColumns><listColumn><listColumnTitle class="lt"><contents><textItem><dataSource><dataItemLabel refDataItem="Year"/></dataSource></textItem></contents></listColumnTitle><listColumnBody class="lc"><contents><textItem><dataSource><dataItemValue refDataItem="Year"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle class="lt"><contents><textItem><dataSource><dataItemLabel refDataItem="Month"/></dataSource></textItem></contents></listColumnTitle><listColumnBody class="lc"><contents><textItem><dataSource><dataItemValue refDataItem="Month"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><listGroups><listGroup refDataItem="Year"/><listGroup refDataItem="Month"><listHeader><listRows><listRow><rowCells><rowCell><contents><textItem><dataSource><staticValue> </staticValue></dataSource></textItem></contents></rowCell><rowCell><contents/></rowCell></rowCells></listRow></listRows></listHeader></listGroup></listGroups></list>
</contents>
</pageBody>
</page>
</reportPages>
</layout>
</layouts>
</report>
Thanks,Paul.It was great.
Thanks Paul for your reply, everything is fine till step 6, the issue is with step 7, I m not getting the desired output. And i m using 8.4..
Nice one Paul.
Quoteeverything is fine till step 6, the issue is with step 7, I m not getting the desired output. And i m using 8.4..
I just tried the steps with 8.4v and worked fine. Seems you have missed something. Have attached the XML fyr...
<report xmlns="http://developer.cognos.com/schemas/report/5.0/" expressionLocale="he">
<modelPath>/content/package[@name='eMeasure']/model[@name='model']</modelPath>
<drillBehavior modelBasedDrillThru="true"/>
<queries>
<query name="Query1">
<source>
<model/>
</source>
<selection><dataItem name="Fiscal Year" aggregate="none" rollupAggregate="none"><expression>[BUSINESS VIEW].[RPT_DISTRIBUTION005].[Fiscal Year]</expression></dataItem><dataItem name="Fiscal Month Name" aggregate="none" rollupAggregate="none"><expression>[BUSINESS VIEW].[RPT_DISTRIBUTION005].[Fiscal Month Name]</expression></dataItem></selection>
</query>
</queries>
<layouts>
<layout>
<reportPages>
<page name="Page1"><style><defaultStyles><defaultStyle refStyle="pg"/></defaultStyles></style>
<pageBody><style><defaultStyles><defaultStyle refStyle="pb"/></defaultStyles></style>
<contents>
<list refQuery="Query1" horizontalPagination="true" name="List1">
<style>
<defaultStyles>
<defaultStyle refStyle="ls"/>
</defaultStyles>
<CSS value="border-collapse:collapse"/>
</style>
<listColumns><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Fiscal Year"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Fiscal Year"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="Fiscal Month Name"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lc"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="Fiscal Month Name"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><listGroups><listGroup refDataItem="Fiscal Year"/><listGroup refDataItem="Fiscal Month Name"><listHeader><listRows><listRow><rowCells><rowCell><contents><textItem><dataSource><staticValue> </staticValue></dataSource></textItem></contents></rowCell><rowCell><contents/></rowCell></rowCells></listRow></listRows></listHeader></listGroup></listGroups></list>
</contents>
</pageBody>
<pageHeader>
<contents>
<block><style><defaultStyles><defaultStyle refStyle="ta"/></defaultStyles></style>
<contents>
<textItem><style><defaultStyles><defaultStyle refStyle="tt"/></defaultStyles></style>
<dataSource>
<staticValue/>
</dataSource>
</textItem>
</contents>
</block>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="ph"/>
</defaultStyles>
<CSS value="padding-bottom:10px"/>
</style>
</pageHeader>
<pageFooter>
<contents>
<table>
<tableRows>
<tableRow>
<tableCells>
<tableCell>
<contents>
<date>
<style>
<dataFormat>
<dateFormat/>
</dataFormat>
</style>
</date>
</contents>
<style>
<CSS value="vertical-align:top;text-align:left;width:25%"/>
</style>
</tableCell>
<tableCell>
<contents>
<pageNumber/>
</contents>
<style>
<CSS value="vertical-align:top;text-align:center;width:50%"/>
</style>
</tableCell>
<tableCell>
<contents>
<time>
<style>
<dataFormat>
<timeFormat/>
</dataFormat>
</style>
</time>
</contents>
<style>
<CSS value="vertical-align:top;text-align:right;width:25%"/>
</style>
</tableCell>
</tableCells>
</tableRow>
</tableRows>
<style>
<defaultStyles>
<defaultStyle refStyle="tb"/>
</defaultStyles>
<CSS value="border-collapse:collapse;width:100%"/>
</style>
</table>
</contents>
<style>
<defaultStyles>
<defaultStyle refStyle="pf"/>
</defaultStyles>
<CSS value="padding-top:10px"/>
</style>
</pageFooter>
</page>
</reportPages>
</layout>
</layouts>
<XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" value="true" output="no"/><XMLAttribute name="listSeparator" value="," output="no"/></XMLAttributes></report>
Thanks, i got the output..
With the same idea, i tried to create blank rows after 5,10,15th rows. It didnt work out..
Help me.....