home *** CD-ROM | disk | FTP | other *** search
- ' Demo Script ACODemo2.Vbs
- '
- ' Alpha Centauri - March 1998
- ' ---------------------------
-
- Dim etFlat ' EdgeType Constant
- Dim tsSpace ' ThousandsSep Constant
- Dim lbShort ' Label Constant
- Dim trHigh ' Threshold Constant
- Dim trMiddle ' Threshold Constant
- Dim trLow ' Threshold Constant
-
- ' Set Constants
- etFlat = 0
- tsSpace = 0
- lbShort = 0
- trHigh = 0
- trMiddle = 1
- trLow = 2
-
- ' Connect to Personal Express and open the ACODemo Database
- Call ACOTable.Connect(False)
- Call ACOTable.Open("C:\PROGRA~1\ACOTABLE\ACODEMO", True)
-
- ACOTable.AutoRefresh = FALSE
-
- ' Remove previously selected Measures
- Call ACOTable.RemoveAllMeasures()
-
- ' Set General Measure Properties
- ACOTable.Decimals = 0
- ACOTable.ThousandsSep = tsSpace
- ACOTable.EdgeTypeDown = etFlat
- ACOTable.FontColor = 255*256*256 + 0 + 0
-
- ' Add the following measures to the table
- Call ACOTable.AddMeasure("ACTUALS")
- Call ACOTable.AddMeasure("BUDGET")
- Call ACOTable.AddMeasure("VARIANCE")
- Call ACOTable.AddMeasure("COSTS")
- Call ACOTable.AddMeasure("MARGINPCT")
-
- ' Set Labels for the measures
- Call ACOTable.SetMeasLabel("ACTUALS", lbShort, "Actuals")
- Call ACOTable.SetMeasLabel("BUDGET", lbShort, "Budget")
- Call ACOTable.SetMeasLabel("VARIANCE", lbShort, "Variance %")
- Call ACOTable.SetMeasLabel("COSTS", lbShort, "Costs")
- Call ACOTable.SetMeasLabel("MARGINPCT", lbShort, "Margin %")
-
- ' Set specific properties for the measure ACTUALS
- Call ACOTable.SetMeasUseDisplayFormat("ACTUALS", TRUE)
- Call ACOTable.SetMeasFillColor("ACTUALS", 163*256*256 + 218*256 + 163)
-
- ' Set specific properties for the measure BUDGET
- Call ACOTable.SetMeasUseDisplayFormat("BUDGET", TRUE)
- Call ACOTable.SetMeasFillColor("BUDGET", 175*256*256 + 175*256 + 228)
-
- ' Set specific properties for the measure COSTS
- Call ACOTable.SetMeasUseDisplayFormat("COSTS", TRUE)
- Call ACOTable.SetMeasFillColor("COSTS", 234*256*256 + 189*256 + 170)
-
- ' Set specific properties for the measure VARIANCE
- Call ACOTable.SetMeasUseDisplayFormat("VARIANCE", TRUE)
- Call ACOTable.SetMeasUseMeasureFormat("VARIANCE", TRUE)
- Call ACOTable.SetMeasSuffix("VARIANCE", " %")
- Call ACOTable.SetMeasDecimals("VARIANCE",2)
-
- ' Set ThresholdCoding Properties for VARIANCE
- Call ACOTable.SetMeasUseThresholdCoding("VARIANCE", TRUE)
- Call ACOTable.SetMeasThreshold("VARIANCE", trHigh, 5)
- Call ACOTable.SetMeasThreshold("VARIANCE", trLow, -3)
- Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trHigh, 0 + 255*256 + 0)
- Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trMiddle, 255*256*256 + 255*256 + 255)
- Call ACOTable.SetMeasThresholdFillColor("VARIANCE", trLow, 0 + 0 + 255)
- Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trHigh, 0 + 0 + 0)
- Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trMiddle , 0 + 0 + 0)
- Call ACOTable.SetMeasThresholdFontColor("VARIANCE", trLow, 255*256*256 + 255*256 + 255)
-
- ' Set specific properties for the measure MARGINPCT
- Call ACOTable.SetMeasUseDisplayFormat("MARGINPCT", TRUE)
- Call ACOTable.SetMeasUseMeasureFormat("MARGINPCT", TRUE)
- Call ACOTable.SetMeasSuffix("MARGINPCT", " %")
- Call ACOTable.SetMeasDecimals("MARGINPCT",2)
-
- ' Set ThresholdCoding Properties for MARGINPCT
- Call ACOTable.SetMeasUseThresholdCoding("MARGINPCT", TRUE)
- Call ACOTable.SetMeasThreshold("MARGINPCT", trHigh, 13)
- Call ACOTable.SetMeasThreshold("MARGINPCT", trLow, 8)
- Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trHigh, 0 + 255*256 + 0)
- Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trMiddle, 128*256*256 + 255*256 + 255)
- Call ACOTable.SetMeasThresholdFillColor("MARGINPCT", trLow, 0 + 0 + 255)
- Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trHigh, 0 + 255*256 + 0)
- Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trMiddle, 128*256*256 + 255*256 + 255)
- Call ACOTable.SetMeasThresholdFontColor("MARGINPCT", trLow, 0 + 0 + 255)
-
- ' Rotate dimensions
- ' Move PRODUCT to the DOWN Edge after GEOGRAPHY
- ' Move TIME to the ACROSS Edge next to MEASURE
- Call ACOTable.Move("PRODUCT", 0, "GEOGRAPHY")
- Call ACOTable.ChangeEdge("TIME", 1)
-
- ' Change the color of the Product Down Dimension Label
- Call ACOTable.SetDimUseDownEdgeFillColor("PRODUCT", TRUE)
- Call ACOTable.SetDimDownEdgeFillColor("PRODUCT", 0 + 255*256 + 0)
-
- ' Select LASTYTD and CURRENTYTD
- Call ACOTable.SetDimHierDimValue("TIME","T0.HIERDIM", "YTD")
- Call ACOTable.SetSelection("TIME", 0, "Lmt TIME To 'LASTYTD\nCURRENTYTD'")
-
- ACOTable.AutoRefresh = TRUE
-
- Call MsgBox("Double down Dimension with distinct colours," + _
- Chr(10) + Chr(13) + _
- "colour coding on Variance" + _
- Chr(10) + Chr(13) + _
- "and Traffic Light colour coding on Margin", _
- 64, "ACOTable DemoScript 2")
-