If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to display one list column values on top of another list column

Started by aswani, 31 Jan 2014 10:26:31 AM

Previous topic - Next topic

aswani

Hello Good Morning,

 

Could you please assist me here with this output, I have two columns one is country and one is state, I would like to put country on top but horizontally, please see the attached picture, above arrow part is what I have know, below arrow part is I am trying to get

 

please advise, I worked on this almost few hours, I almost gave up, could somebody please assist?

 

I tried using cross tab country column under column then state column under country column (in columns) but it is coming as not as I wanted, also I tried sections but I required to be horizontal list,   

 

Thank you in Advance

Milani

aswani


anjidwh.cognos

Hi

find the XML. Make the formatting.

<report xmlns="http://developer.cognos.com/schemas/report/7.0/" useStyleVersion="10" expressionLocale="en-us">
            <modelPath>/content/folder[@name='SAM']/folder[@name='Packages']/package[@name='SAM_Finance_OLTP']/model[@name='2013-11-21T18:39:10.777Z']</modelPath>
            <drillBehavior modelBasedDrillThru="true"/>
            <layouts>
               <layout>
                  <reportPages>
                     <page name="Page1" refQuery="Query2">
                        <style>
                           <defaultStyles>
                              <defaultStyle refStyle="pg"/>
                           </defaultStyles>
                        </style>
                        <pageBody>
                           <style>
                              <defaultStyles>
                                 <defaultStyle refStyle="pb"/>
                              </defaultStyles>
                           </style>
                           <contents><list horizontalPagination="true" refQuery="Query2" name="List1">
         
         
         
         <style>
            <CSS value="border-collapse:collapse"/>
            <defaultStyles>
               <defaultStyle refStyle="ls"/>
            </defaultStyles>
         </style>
      <listColumns><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="COUNTRY"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="COUNTRY"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle><style><defaultStyles><defaultStyle refStyle="lt"/></defaultStyles></style><contents><textItem><dataSource><dataItemLabel refDataItem="STATE"/></dataSource></textItem></contents></listColumnTitle><listColumnBody><style><defaultStyles><defaultStyle refStyle="lm"/></defaultStyles></style><contents><textItem><dataSource><dataItemValue refDataItem="STATE"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns><sortList><sortItem refDataItem="COUNTRY" sortOrder="ascending"/></sortList></list><crosstab horizontalPagination="true" name="Crosstab1" refQuery="Query2">
         <crosstabCorner>
            <contents/>
            <style>
               <defaultStyles>
                  <defaultStyle refStyle="xm"/>
               </defaultStyles>
            </style>
         </crosstabCorner>
         
         
         <style>
            <CSS value="border-collapse:collapse"/>
            <defaultStyles>
               <defaultStyle refStyle="xt"/>
            </defaultStyles>
         </style>
      <crosstabFactCell><contents><textItem><dataSource><cellValue/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="mv"/></defaultStyles></style></crosstabFactCell><crosstabColumns><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="COUNTRY" edgeLocation="e1"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><factCell><contents><layoutComponentRef refLayoutElement="Crosstab2"/></contents></factCell></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabColumns><masterDetailLinks/></crosstab><crosstab horizontalPagination="true" name="Crosstab2" refQuery="Query2">
         <crosstabCorner>
            <contents/>
            <style>
               <defaultStyles>
                  <defaultStyle refStyle="xm"/>
               </defaultStyles>
            <CSS value="display:none"/></style>
         </crosstabCorner>
         
         <crosstabColumnNodeStyle><style><CSS value="display:none"/></style></crosstabColumnNodeStyle>
         <style>
            <CSS value="border-collapse:collapse"/>
            <defaultStyles>
               <defaultStyle refStyle="xt"/>
            </defaultStyles>
         </style>
      <crosstabFactCell><contents><textItem><dataSource><cellValue/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="mv"/></defaultStyles></style></crosstabFactCell><crosstabRows><crosstabNode><crosstabNestedNodes><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="STATE" edgeLocation="e2"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><factCell><style><CSS value="display:none"/></style></factCell></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabNestedNodes><crosstabNodeMembers><crosstabNodeMember refDataItem="COUNTRY" edgeLocation="e1"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles><CSS value="display:none"/></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabRows><masterDetailLinks><masterDetailLink><masterContext><dataItemContext refDataItem="COUNTRY"/></masterContext><detailContext><dataItemContext refDataItem="COUNTRY"/></detailContext></masterDetailLink></masterDetailLinks></crosstab></contents>
                        </pageBody>
                     </page>
                  </reportPages>
               </layout>
            </layouts>
         <XMLAttributes><XMLAttribute name="RS_CreateExtendedDataItems" value="false" output="no"/><XMLAttribute name="listSeparator" value="," output="no"/></XMLAttributes><queries><query name="Query2">
         <source>
            
         <sqlQuery name="SQL1" dataSource="SAMOLTP">
         <sqlText>select 'USA' AS COUNTRY, 'Jersey' as STATE from dual

UNION

select 'USA' AS COUNTRY, 'Ohilo' as STATE from dual

UNION

select 'USA' AS COUNTRY, 'Neveda' as STATE from dual

UNION

select 'USA' AS COUNTRY, 'California' as STATE from dual

UNION

select 'INDIA' AS COUNTRY, 'AP' as STATE from dual


UNION

select 'INDIA' AS COUNTRY, 'UP' as STATE from dual

UNION

select 'INDIA' AS COUNTRY, 'Karnataka' as STATE from dual

</sqlText>
      <mdProjectedItems><mdProjectedItem name="COUNTRY"/><mdProjectedItem name="STATE"/></mdProjectedItems></sqlQuery></source>
         <selection><dataItem name="COUNTRY"><expression>[SQL1].[COUNTRY]</expression></dataItem><dataItem name="STATE"><expression>[SQL1].[STATE]</expression></dataItem></selection>
      </query></queries></report>


Thanks
SRK