summary.xts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2017
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  13. <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  14. <!-- get the debug logic sheet -->
  15. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  16. <!-- get the new theme stuff -->
  17. <xts:logicsheet path="logicsheets/portal.xsl"/>
  18. <xts:logicsheet path="qs/logicsheets/dialogs.xsl"/>
  19. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  20. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  21. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  22. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  23. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  24. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  25. <!-- apply the form logic -->
  26. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  27. <xsl:stylesheet version="1.0"
  28. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  29. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  30. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  31. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  32. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  33. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  34. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  35. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  36. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  37. xmlns:qsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/"
  38. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  39. exclude-result-prefixes="xsl xts lyt pf dp df cp cf dbg qsdlg xtsext">
  40. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  41. <!-- add any theme variables -->
  42. <df:variables/>
  43. <pf:variables/>
  44. <xsl:key name="param-name" match="/root/env/param" use="@name"/>
  45. <!-- start the output -->
  46. <xsl:template match="/root">
  47. <xsl:variable name="xxDlgAdv" select="key('param-name','xxSummaryDlgAdvanced')"/>
  48. <dp:page>
  49. <dp:script>
  50. <script type="text/javascript">
  51. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
  52. <xsl:text/>//<xsl:text/>
  53. </script>
  54. <script type="text/javascript">
  55. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CDialogManager.js</xsl:attribute>
  56. <xsl:text/>//<xsl:text/>
  57. </script>
  58. <script type="text/javascript">&lt;!--
  59. var cf=getConfigFrame?getConfigFrame():null;
  60. var goDialogManager = new CDialogManager();
  61. function execute()
  62. {
  63. var detailAgg = "mixed";
  64. if ("<xsl:value-of select="xtsext:javascriptencode(string($xxDlgAdv))"/>" == "true")
  65. detailAgg = document.f.detailAggType.value;
  66. cf.doSummary(document.f.summaryAggType.value, detailAgg);
  67. }
  68. function updateDlgLists(selection)
  69. {
  70. if ((selection == "none" || selection == "count" || selection == "countDistinct") &amp;&amp; cf.dlgGlobalGetParm("xxIsMeasure") == "nonMeasuresOnly")
  71. cf.summarizeNonMeasure(selection);
  72. }
  73. function advancedDlg(toAdvancedMode)
  74. {
  75. cf.summarize(toAdvancedMode, document.f.summaryAggType.value);
  76. }
  77. function createNewOptAddToSelect(optStr, optType, currentAgg, selectObj)
  78. {
  79. var newOpt = new Option(optStr, optType);
  80. if (cf.dlgGlobalGetParm(currentAgg) == optType)
  81. newOpt.selected = true;
  82. selectObj.options[selectObj.options.length] = newOpt;
  83. }
  84. function init()
  85. {
  86. attachMouseEvents();
  87. if (cf &amp;&amp; cf.showDialogFrame) cf.showDialogFrame(<xsl:choose><xsl:when test="$xxDlgAdv ='true'">250</xsl:when><xsl:otherwise>190</xsl:otherwise></xsl:choose>);
  88. var select = document.f.detailAggType;
  89. if (typeof select == "object")
  90. {
  91. if (cf.dlgGlobalGetParm("xxCurrentDetailAgg") == 'mixed')
  92. {
  93. var newOpt = new Option("", "mixed");
  94. newOpt.selected = true;
  95. select.options[select.options.length] = newOpt;
  96. }
  97. var detailAggTypeOptions = cf.dlgGlobalGetParm("xxDetailAggTypeOptions");
  98. for (var i=0; i &lt; detailAggTypeOptions.length; i++)
  99. {
  100. createNewOptAddToSelect(detailAggTypeOptions[i].text, detailAggTypeOptions[i].value, "xxCurrentDetailAgg", select);
  101. }
  102. }
  103. select = document.f.summaryAggType;
  104. if (typeof select == "object")
  105. {
  106. if (cf.dlgGlobalGetParm("xxShowMixed") == true)
  107. {
  108. var newOpt = new Option("", "mixed");
  109. newOpt.selected = true;
  110. select.options[select.options.length] = newOpt;
  111. }
  112. var summaryAggTypeOptions = cf.dlgGlobalGetParm("xxSummaryAggTypeOptions");
  113. for (var i=0; i &lt; summaryAggTypeOptions.length; i++)
  114. {
  115. setTimeout('createNewOptAddToSelect("'+summaryAggTypeOptions[i].text+'", "'+summaryAggTypeOptions[i].value+'", "xxCurrentSummaryAgg", document.f.summaryAggType);', (1+i)*5);
  116. }
  117. }
  118. if (cf.dlgGlobalGetParm("xxDisableAdvLink") != true)
  119. {
  120. <xsl:choose>
  121. <xsl:when test="$xxDlgAdv ='false'">
  122. if (cf.dlgGlobalGetParm("CanUseCellAggregation") == true)
  123. {
  124. var adv = document.getElementById("advLink");
  125. adv.href = "javascript:advancedDlg(true)";
  126. adv.appendChild(document.createTextNode("<xts:string id="DIALOG_ADVANCED" encode="javascript"/>"));
  127. }
  128. </xsl:when>
  129. <xsl:otherwise>
  130. if (cf.dlgGlobalGetParm("CanUseCellAggregation") == true)
  131. {
  132. var adv = document.getElementById("advLink");
  133. adv.href = "javascript:advancedDlg(false)";
  134. adv.appendChild(document.createTextNode("<xts:string id="DIALOG_BASIC" encode="javascript"/>"));
  135. }
  136. </xsl:otherwise>
  137. </xsl:choose>
  138. }
  139. }
  140. //--&gt;</script>
  141. <script type="text/javascript">
  142. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/dialogs/executeButton.js</xsl:attribute>
  143. <xsl:text/>//<xsl:text/>
  144. </script>
  145. </dp:script>
  146. <form style="margin:0px" name="f" method="POST" onsubmit="return false;">
  147. <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
  148. <tr>
  149. <td width="100%" height="0%">
  150. <!-- dialog header -->
  151. <dp:header help="false">
  152. <!-- header titles -->
  153. <dp:title>
  154. <xsl:choose>
  155. <xsl:when test="$xxDlgAdv ='true'">
  156. <xts:string id="SUMMARY_TITLE_ADVANCED"/>
  157. </xsl:when>
  158. <xsl:otherwise>
  159. <xts:string id="SUMMARY_TITLE"/>
  160. </xsl:otherwise>
  161. </xsl:choose>
  162. </dp:title>
  163. <!-- close link for the header -->
  164. <dp:close>
  165. <a href="javascript:getConfigFrame().hideDialogFrame()">
  166. <dp:closeMarker/>
  167. </a>
  168. </dp:close>
  169. <!-- header links -->
  170. <dp:headerLinks>
  171. <dp:headerLink>
  172. <dp:hl_attribute name="id">advLink</dp:hl_attribute>
  173. </dp:headerLink>
  174. </dp:headerLinks>
  175. <!-- description (hint text) -->
  176. <dp:description>
  177. <xts:string id="SUMMARY_DESCRIPTION"/>
  178. </dp:description>
  179. </dp:header>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td width="100%" height="100%" valign="top">
  184. <!-- layout -->
  185. <lyt:layout style="1" border="no">
  186. <lyt:section>
  187. <xsl:if test="$xxDlgAdv='true'">
  188. <dp:choice>
  189. <dp:section1>
  190. <table height="100%">
  191. <tr>
  192. <td valign="top">
  193. <img>
  194. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/images/summarize_cell_list.gif</xsl:attribute>
  195. </img>
  196. </td>
  197. </tr>
  198. </table>
  199. </dp:section1>
  200. <dp:section2>
  201. <dp:input>
  202. <dp:section1>
  203. <xts:string id="SUMMARY_FOR_CELLS"/>
  204. </dp:section1>
  205. <dp:section2>
  206. <select name="detailAggType" onChange="updateDlgLists(this.options[this.selectedIndex].value)"/>
  207. </dp:section2>
  208. </dp:input>
  209. </dp:section2>
  210. </dp:choice>
  211. </xsl:if>
  212. <dp:choice>
  213. <dp:section1>
  214. <table height="100%">
  215. <tr>
  216. <td valign="top">
  217. <img>
  218. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/images/summarize_footer_list.gif</xsl:attribute>
  219. </img>
  220. </td>
  221. </tr>
  222. </table>
  223. </dp:section1>
  224. <dp:section2>
  225. <dp:input>
  226. <dp:section1>
  227. <xts:string id="SUMMARY_FOR_FOOTERS"/>
  228. </dp:section1>
  229. <dp:section2>
  230. <select name="summaryAggType"/>
  231. </dp:section2>
  232. </dp:input>
  233. </dp:section2>
  234. </dp:choice>
  235. </lyt:section>
  236. </lyt:layout>
  237. </td>
  238. </tr>
  239. <tr>
  240. <td width="100%" height="100%">
  241. <!-- Use default buttons [ OK = execute() and CANCEL = hideDialogFrame() ] -->
  242. <qsdlg:defaultButtons/>
  243. </td>
  244. </tr>
  245. <!-- <dbg:dumpxml select="/"/> -->
  246. </table>
  247. </form>
  248. </dp:page>
  249. </xsl:template>
  250. </xsl:stylesheet>
  251. </xts:block>
  252. </xts:morphlet>