run_report.xts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: AGS
  5. (C) Copyright IBM Corp. 2005, 2015
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml" requiredCapability="canUseEventStudio">
  9. <!--
  10. =======================================================================================
  11. execute_report_viewer
  12. Make a page who's sole purpose is to get the report spec - and fire itself off to report viewer. Just make a form and post it
  13. =======================================================================================
  14. -->
  15. <xts:block id="execute_report_viewer" dependency="" mode="output" processor="XSLT" type="exec" mimeType="text/html">
  16. <!-- portal specific information -->
  17. <xts:logicsheet path="logicsheets/portal.xsl"/>
  18. <!-- Get the new theme framework. -->
  19. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  20. <!-- apply the form logic -->
  21. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  22. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:x="x" exclude-result-prefixes="xsl dp pf utml xtsext x">
  23. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  24. <!-- add any theme variables -->
  25. <pf:variables/>
  26. <!-- start the output -->
  27. <xsl:template match="root">
  28. <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text><dp:page>
  29. <form name="pform" method="post" action="{$gateway}">
  30. <input type="hidden" name="b_action" id="b_action" value="cognosViewer"/>
  31. <input type="hidden" name="ui.action" id="ui.action" value="run"/>
  32. <input type="hidden" name="errURL" id="errURL" value="javascript:window.close();"/>
  33. <input type="hidden" name="ui.spec" id="ui.spec" value=""/>
  34. <input type="hidden" name="ui.format" id="ui.format" value="HTML"/>
  35. <input type="hidden" name="outputLocale" id="outputLocale" value=""/>
  36. <input type="hidden" name="outputPageDefinition" id="outputPageDefinition" value=""/>
  37. <input type="hidden" name="outputPageOrientation" id="outputPageOrientation" value=""/>
  38. <input type="hidden" name="verticalElements" id="verticalElements" value=""/>
  39. <input type="hidden" name="horizontalElements" id="horizontalElements" value=""/>
  40. <input type="hidden" name="prompt" id="prompt" value="true"/>
  41. <input type="hidden" name="ui.folder" id="ui.folder" value=""/>
  42. <input type="hidden" name="cafcontextid" id="cafcontextid" value="{/root/env/param[@name='cafcontextid']}"/>
  43. <input type="hidden" name="cv.toolbar" id="cv.toolbar" value="{/root/env/param[@name='cv.toolbar']}"/>
  44. <input type="hidden" name="cv.id" id="cv.id" value="{/root/env/param[@name='cv.id']}"/>
  45. <input type="hidden" name="ui.routingServerGroup" id="ui.routingServerGroup" value="{/root/env/param[@name='ui.routingServerGroup']}"/>
  46. </form>
  47. <dp:script>
  48. <script type="text/javascript">
  49. function init()
  50. {
  51. // have to ask the opening window to build us a report spec
  52. var noDataItems = window.opener.noDataItems();
  53. if(noDataItems)
  54. {
  55. var inline = window.opener.createHiddenInput(document, "m", "ags/noData.xts")
  56. document.pform.appendChild(inline);
  57. document.pform.b_action.value="xts.run";
  58. // submit it
  59. document.pform.submit();
  60. }
  61. else {
  62. runReport();
  63. }
  64. }
  65. function runReport() {
  66. //get the spec
  67. var inlineSpec = window.opener.cfgGet("inlineSpec");
  68. if (inlineSpec != undefined &amp;&amp; inlineSpec != '') {
  69. // set the model path for server routing requirements
  70. document.pform['ui.folder'].value = window.opener.cfgGet("cmLastModel");
  71. // change some values - set the spec
  72. document.pform['ui.spec'].value=inlineSpec;
  73. // submit it
  74. document.pform.submit();
  75. }
  76. }
  77. </script>
  78. </dp:script>
  79. </dp:page>
  80. </xsl:template>
  81. </xsl:stylesheet>
  82. </xts:block>
  83. <!--
  84. ================================================================================
  85. debug
  86. ================================================================================
  87. -->
  88. <xts:block id="debug" type="exec" mode="output" processor="XSLT" condition=".[/root/session/param[@name = 'debug'] = '1']" mandatory="false" mimeType="text/html" dependency="execute_report_viewer">
  89. <!-- Get the debug logic sheet -->
  90. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  91. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg">
  92. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  93. <xsl:template match="/">
  94. <dbg:dumpxml select="/root"/>
  95. </xsl:template>
  96. </xsl:stylesheet>
  97. </xts:block>
  98. </xts:morphlet>