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 render a prompt

Started by cognosfolks, 24 Sep 2008 01:45:02 AM

Previous topic - Next topic

cognosfolks

i am using gosalesretailers package
i have a list report which contains productline(query item),i have a value prompt which filters the productline.say prompt1
and a value prompt with static values (show,hide) say prompt2


now what i need is ---
when i select 'show' in prompt2 -prompt1 should should be displayed and filter the data on selecting a valve.
when i select 'hide' in prompt2-prompt1 should not be displayed ,all the records should be displayed in the report .

vpmbala

Copy the below Spec & open the report..your question is answered...





<report xmlns="http://developer.cognos.com/schemas/report/2.0/" expressionLocale="en-us"><!--RS:8.1-->
   <modelPath>/content/package[@name='GO Sales and Retailers']/model[@name='model']</modelPath>
   <queries>
      <query name="Query1">
         <source>
            <model/>
         </source>
         <selection><dataItem name="Product line" aggregate="none"><expression>[gosales_goretailers].[Products].[Product line]</expression></dataItem><dataItem name="Product name" aggregate="none"><expression>[gosales_goretailers].[Products].[Product name]</expression></dataItem></selection>
      <detailFilters><detailFilter use="optional"><filterExpression>if(?p2? ='S') then ([gosales_goretailers].[Products].[Product line]in ?p1?) else (1=1)</filterExpression></detailFilter></detailFilters></query>
   <query name="Query2"><source><model/></source><selection><dataItem name="Product line" aggregate="none"><expression>[gosales_goretailers].[Products].[Product line]</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="Product line"/></dataSource></textItem></contents></listColumnTitle><listColumnBody class="lc"><contents><textItem><dataSource><dataItemValue refDataItem="Product line"/></dataSource></textItem></contents></listColumnBody></listColumn><listColumn><listColumnTitle class="lt"><contents><textItem><dataSource><dataItemLabel refDataItem="Product name"/></dataSource></textItem></contents></listColumnTitle><listColumnBody class="lc"><contents><textItem><dataSource><dataItemValue refDataItem="Product name"/></dataSource></textItem></contents></listColumnBody></listColumn></listColumns></list>
                  </contents>
               </pageBody>
               <pageHeader class="ph">
                  <contents>
                     <block class="ta">
                        <contents>
                           <textItem class="tt">
                              <dataSource>
                                 <staticValue/>
                              </dataSource>
                           </textItem>
                        </contents>
                     </block>
                  </contents>
                  <style>
                     <CSS value="padding-bottom:10px"/>
                  </style>
               </pageHeader>
               <pageFooter class="pf">
                  <contents>
                     <table class="tb">
                        <tableRows>
                           <tableRow>
                              <tableCells>
                                 <tableCell>
                                    <contents>
                                       <textItem>
                                          <dataSource>
                                             <reportExpression>AsOfDate()</reportExpression>
                                          </dataSource>
                                       </textItem>
                                    </contents>
                                    <style>
                                       <CSS value="vertical-align:top;text-align:left;width:25%"/>
                                    </style>
                                 </tableCell>
                                 <tableCell>
                                    <contents>
                                       <textItem>
                                          <dataSource>
                                             <staticValue>- </staticValue>
                                          </dataSource>
                                       </textItem>
                                       <textItem>
                                          <dataSource>
                                             <reportExpression>PageNumber()</reportExpression>
                                          </dataSource>
                                       </textItem>
                                       <textItem>
                                          <dataSource>
                                             <staticValue> -</staticValue>
                                          </dataSource>
                                       </textItem>
                                    </contents>
                                    <style>
                                       <CSS value="vertical-align:top;text-align:center;width:50%"/>
                                    </style>
                                 </tableCell>
                                 <tableCell>
                                    <contents>
                                       <textItem>
                                          <dataSource>
                                             <reportExpression>AsOfTime()</reportExpression>
                                          </dataSource>
                                       </textItem>
                                    </contents>
                                    <style>
                                       <CSS value="vertical-align:top;text-align:right;width:25%"/>
                                    </style>
                                 </tableCell>
                              </tableCells>
                           </tableRow>
                        </tableRows>
                        <style>
                           <CSS value="border-collapse:collapse;width:100%"/>
                        </style>
                     </table>
                  </contents>
                  <style>
                     <CSS value="padding-top:10px"/>
                  </style>
               </pageFooter>
            </page>
         </reportPages>
      <promptPages><page class="pp" name="Prompt Page1">
               <pageHeader class="hp">
                  <contents>
                     <block class="ta">
                        <contents>
                           <textItem class="tt">
                              <dataSource>
                                 <staticValue/>
                              </dataSource>
                           </textItem>
                        </contents>
                     </block>
                  </contents>
               </pageHeader>
               <pageBody class="py">
                  <contents><table class="tb"><tableRows><tableRow><tableCells><tableCell><contents/></tableCell><tableCell><contents><selectValue parameter="p2" autoSubmit="true" selectValueUI="radioGroup"><defaultSelections><defaultSimpleSelection>S</defaultSimpleSelection></defaultSelections><selectOptions><selectOption useValue="H"><displayValue>Hide</displayValue></selectOption><selectOption useValue="S"><displayValue>Show</displayValue></selectOption></selectOptions></selectValue>
                                    </contents></tableCell></tableCells></tableRow><tableRow><tableCells><tableCell><contents/></tableCell><tableCell><contents><selectValue parameter="p1" refQuery="Query2" selectValueUI="listBox" multiSelect="true" range="false" required="true" cascadeOn="p2"><useItem refDataItem="Product line"/></selectValue>
                                    </contents></tableCell></tableCells><conditionalStyles><conditionalStyleCases refVariable="Boolean1"><conditionalStyle refVariableValue="1"><CSS value="display:none"/></conditionalStyle></conditionalStyleCases><conditionalStyleDefault/></conditionalStyles></tableRow><tableRow><tableCells><tableCell><contents/></tableCell><tableCell><contents/></tableCell></tableCells></tableRow></tableRows><style><CSS value="border-collapse:collapse;width:100%"/></style></table></contents>
               </pageBody>
               <pageFooter class="fp">
                  <contents>
                     <promptButton type="cancel" class="bp">
                        <contents/>
                     </promptButton>
                     <promptButton type="back" class="bp">
                        <contents/>
                     </promptButton>
                     <promptButton type="next" class="bp">
                        <contents/>
                     </promptButton>
                     <promptButton type="finish" class="bp">
                        <contents/>
                     </promptButton>
                  </contents>
               </pageFooter>
            </page>
         </promptPages></layout>
   </layouts>
<reportVariables><reportVariable type="boolean" name="Boolean1">
         <reportExpression>ParamValue('p2')='H'</reportExpression>
         <variableValues>
            <variableValue value="1"/>
         </variableValues>
      </reportVariable>
   </reportVariables></report>