displayoptions.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: pps
  4. //
  5. // (C) Copyright IBM Corp. 2005, 2017
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. // This forms the javascript functions used for the display options
  9. // action pane for PowerPlay Studio.
  10. // The functions are Internet Explorer specific.
  11. function init() {
  12. topparent.openActionPane();
  13. ContextMenu.initialize(true,false);
  14. // adjust the size of the action pane to accomodate the display option pane.
  15. topparent.setActionPaneHeight("220");
  16. }
  17. function applyDisplayOptions (forceClose) {
  18. var hiddenForm = topparent.getXtabFrame().document.getElementById("fhidden");
  19. if(!hiddenForm) {
  20. return;
  21. }
  22. disableButton(document.getElementById("applyButton"));
  23. disableButton(document.getElementById("okButton"));
  24. var htmlToAppend = "";
  25. var command = "";
  26. // Show Values As...
  27. var valuesOption = document.getElementById("values_as_option");
  28. command += "OV:" + valuesOption[valuesOption.selectedIndex].value + "\t\t";
  29. // Currency....
  30. var currencyOption = document.getElementById("currency_option");
  31. if (currencyOption)
  32. command += "OD:" + currencyOption[currencyOption.selectedIndex].value + "\t\t";
  33. // Number of Rows....
  34. var numRowsOption = document.getElementById("numrows_option");
  35. command += "PR:" + numRowsOption.value + "\t\t";
  36. // Number of Columns....
  37. var numColsOption = document.getElementById("numcols_option");
  38. command += "PC:" + numColsOption.value + "\t\t";
  39. var hideCalcCats = document.getElementById("HideCalcs");
  40. var result;
  41. if(hideCalcCats.checked)
  42. result = 1;
  43. else
  44. result = 0;
  45. if(hiddenForm.PPS_CC == null) {
  46. if (result)
  47. command += "OPPS_CC" + "\t\t";
  48. } else {
  49. if (result != hiddenForm.PPS_CC.value)
  50. command += "OPPS_CC" + "\t\t";
  51. }
  52. var shortNames = document.getElementById("ShortNames");
  53. if(shortNames.checked)
  54. result = 1;
  55. else
  56. result = 0;
  57. var dimTreeFrame = topparent.getDimTreeFrame();
  58. if(hiddenForm.SHN == null) {
  59. if (result){
  60. command += "OSHN";
  61. dimTreeFrame.toggleNames(result);
  62. }
  63. } else {
  64. if (result != hiddenForm.SHN.value) {
  65. command += "OSHN";
  66. dimTreeFrame.toggleNames(result);
  67. }
  68. }
  69. if(htmlToAppend.length > 0) {
  70. // set the form's display style to "none" to avoid the xtab shifting downwards. For some unknown reason, IE adjusts the view for this new
  71. // input object even though it is hidden.
  72. hiddenForm.style.display = "none";
  73. hiddenForm.innerHTML += htmlToAppend;
  74. }
  75. if (command != "")
  76. {
  77. if (forceClose)
  78. topparent.clearActionPane();
  79. topparent.getXtabFrame().doit(command);
  80. }
  81. return true;
  82. }
  83. function onOK() {
  84. applyDisplayOptions(true)
  85. }
  86. function processInput(hw) {
  87. if ((chartType == 1) || (chartType == 6)) {
  88. if (hw == "h")
  89. document.getElementById("WidthScaling").value = document.getElementById("HeightScaling").value;
  90. else
  91. document.getElementById("HeightScaling").value = document.getElementById("WidthScaling").value;
  92. }
  93. }