home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / olaptble / _setup.1 / ACODemo2.vbs < prev    next >
Encoding:
Text File  |  1998-03-20  |  4.6 KB  |  118 lines

  1. ' Demo Script ACODemo2.Vbs
  2. '
  3. ' Alpha Centauri - March 1998
  4. ' ---------------------------
  5.  
  6. Dim etFlat    ' EdgeType Constant
  7. Dim tsSpace    ' ThousandsSep Constant
  8. Dim lbShort    ' Label Constant
  9. Dim trHigh    ' Threshold Constant
  10. Dim trMiddle    ' Threshold Constant
  11. Dim trLow    ' Threshold Constant
  12.  
  13. ' Set Constants
  14. etFlat   = 0
  15. tsSpace  = 0
  16. lbShort  = 0
  17. trHigh   = 0
  18. trMiddle = 1
  19. trLow    = 2
  20.  
  21. ' Connect to Personal Express and open the ACODemo Database
  22. Call ACOTable.Connect(False)
  23. Call ACOTable.Open("C:\PROGRA~1\ACOTABLE\ACODEMO", True)
  24.  
  25. ACOTable.AutoRefresh = FALSE
  26.  
  27. ' Remove previously selected Measures
  28. Call ACOTable.RemoveAllMeasures()
  29.  
  30. ' Set General Measure Properties
  31. ACOTable.Decimals     = 0
  32. ACOTable.ThousandsSep = tsSpace
  33. ACOTable.EdgeTypeDown = etFlat
  34. ACOTable.FontColor    = 255*256*256 + 0 + 0
  35.  
  36. ' Add the following measures to the table 
  37. Call ACOTable.AddMeasure("ACTUALS")
  38. Call ACOTable.AddMeasure("BUDGET")
  39. Call ACOTable.AddMeasure("VARIANCE")
  40. Call ACOTable.AddMeasure("COSTS")
  41. Call ACOTable.AddMeasure("MARGINPCT")
  42.  
  43. ' Set Labels for the measures
  44. Call ACOTable.SetMeasLabel("ACTUALS", lbShort, "Actuals")
  45. Call ACOTable.SetMeasLabel("BUDGET", lbShort, "Budget")
  46. Call ACOTable.SetMeasLabel("VARIANCE", lbShort, "Variance %")
  47. Call ACOTable.SetMeasLabel("COSTS", lbShort, "Costs")
  48. Call ACOTable.SetMeasLabel("MARGINPCT", lbShort, "Margin %")
  49.  
  50. ' Set specific properties for the measure ACTUALS
  51. Call ACOTable.SetMeasUseDisplayFormat("ACTUALS", TRUE)
  52. Call ACOTable.SetMeasFillColor("ACTUALS", 163*256*256 + 218*256 + 163)
  53.  
  54. ' Set specific properties for the measure BUDGET
  55. Call ACOTable.SetMeasUseDisplayFormat("BUDGET", TRUE)
  56. Call ACOTable.SetMeasFillColor("BUDGET", 175*256*256 + 175*256 + 228)
  57.  
  58. ' Set specific properties for the measure COSTS
  59. Call ACOTable.SetMeasUseDisplayFormat("COSTS", TRUE)
  60. Call ACOTable.SetMeasFillColor("COSTS", 234*256*256 + 189*256 + 170)
  61.  
  62. ' Set specific properties for the measure VARIANCE
  63. Call ACOTable.SetMeasUseDisplayFormat("VARIANCE", TRUE)
  64. Call ACOTable.SetMeasUseMeasureFormat("VARIANCE", TRUE)
  65. Call ACOTable.SetMeasSuffix("VARIANCE", " %")
  66. Call ACOTable.SetMeasDecimals("VARIANCE",2)
  67.  
  68. ' Set ThresholdCoding Properties for VARIANCE
  69. Call ACOTable.SetMeasUseThresholdCoding("VARIANCE", TRUE)
  70. Call ACOTable.SetMeasThreshold("VARIANCE", trHigh, 5)
  71. Call ACOTable.SetMeasThreshold("VARIANCE", trLow, -3)
  72. Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trHigh, 0 + 255*256 + 0)
  73. Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trMiddle, 255*256*256 + 255*256 + 255)
  74. Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trLow, 0 + 0 + 255)
  75. Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trHigh, 0 + 0 + 0)
  76. Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trMiddle , 0 + 0 + 0)
  77. Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trLow, 255*256*256 + 255*256 + 255)
  78.  
  79. ' Set specific properties for the measure MARGINPCT
  80. Call ACOTable.SetMeasUseDisplayFormat("MARGINPCT", TRUE)
  81. Call ACOTable.SetMeasUseMeasureFormat("MARGINPCT", TRUE)
  82. Call ACOTable.SetMeasSuffix("MARGINPCT", " %")
  83. Call ACOTable.SetMeasDecimals("MARGINPCT",2)
  84.  
  85. ' Set ThresholdCoding Properties for MARGINPCT
  86. Call ACOTable.SetMeasUseThresholdCoding("MARGINPCT", TRUE)
  87. Call ACOTable.SetMeasThreshold("MARGINPCT", trHigh, 13)
  88. Call ACOTable.SetMeasThreshold("MARGINPCT", trLow, 8)
  89. Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trHigh, 0 + 255*256 + 0)
  90. Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trMiddle, 128*256*256 + 255*256 + 255)
  91. Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trLow, 0 + 0 + 255)
  92. Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trHigh, 0 + 255*256 + 0)
  93. Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trMiddle, 128*256*256 + 255*256 + 255)
  94. Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trLow, 0 + 0 + 255)
  95.  
  96. ' Rotate dimensions
  97. ' Move PRODUCT to the DOWN Edge after GEOGRAPHY
  98. ' Move TIME to the ACROSS Edge next to MEASURE
  99. Call ACOTable.Move("PRODUCT", 0, "GEOGRAPHY")
  100. Call ACOTable.ChangeEdge("TIME", 1)
  101.  
  102. ' Change the color of the Product Down Dimension Label
  103. Call ACOTable.SetDimUseDownEdgeFillColor("PRODUCT", TRUE)
  104. Call ACOTable.SetDimDownEdgeFillColor("PRODUCT", 0 + 255*256 + 0)
  105.  
  106. ' Select LASTYTD and CURRENTYTD
  107. Call ACOTable.SetDimHierDimValue("TIME","T0.HIERDIM", "YTD")
  108. Call ACOTable.SetSelection("TIME", 0, "Lmt TIME To 'LASTYTD\nCURRENTYTD'")
  109.  
  110. ACOTable.AutoRefresh = TRUE
  111.  
  112. Call MsgBox("Double down Dimension with distinct colours," + _
  113.          Chr(10) + Chr(13) + _
  114.             "colour coding on Variance" + _
  115.         Chr(10) + Chr(13) + _
  116.             "and Traffic Light colour coding on Margin", _
  117.     64, "ACOTable DemoScript 2")
  118.