forecast_api/Master Template.xlsm_EXPORTS/shWalk.cls
PhilRunninger 44dd489377 Use streamlined code to get pivot table key fields.
This allows me to get rid of unnecessary (and duplicated) code.
2024-04-01 17:54:09 -04:00

72 lines
1.8 KiB
OpenEdge ABL

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "shWalk"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
'Option Explicit
'
'Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
' Dim pt As PivotTable
' Set pt = ActiveSheet.PivotTables("ptWalk")
' Dim intersec As Range
' Set intersec = Intersect(Target, pt.DataBodyRange)
'
' If intersec Is Nothing Then
' Exit Sub
' ElseIf intersec.address <> Target.address Then
' Exit Sub
' End If
'
' Cancel = True
'
' Dim i As Long
' Dim j As Long
' Dim k As Long
'
' Dim ri As PivotItemList
' Dim ci As PivotItemList
' Dim df As Object
' Dim rd As Object
' Dim cd As Object
' Dim dd As Object
'
' Dim pf As PivotField
' Dim pi As PivotItem
'
' Set ri = Target.Cells.PivotCell.RowItems
' Set ci = Target.Cells.PivotCell.ColumnItems
' Set df = Target.Cells.PivotCell.DataField
'
' Set rd = Target.Cells.PivotTable.RowFields
' Set cd = Target.Cells.PivotTable.ColumnFields
'
' dim idx as Integer
'
' handler.sql = ""
' handler.jsql = ""
' ReDim handler.sc(ri.Count - 1, 1)
'
' For i = 1 To ri.Count
' key = ri(i).Parent.Name
' value = ri(i).value
' If i <> 1 Then handler.sql = handler.sql & vbCrLf & "AND "
' If i <> 1 Then handler.jsql = handler.jsql & vbCrLf & ","
' handler.sql = handler.sql & key & " = '" & escape_sql(value) & "'"
' jsql = jsql & """" & key & """:""" & escape_json(value) & """"
' handler.sc(idx, 0) = key
' handler.sc(idx, 1) = value
' idx = idx + 1
' Next i
'
' scenario = "{" & handler.jsql & "}"
'
' Call handler.load_config
' Call handler.load_fpvt
'
'End Sub