Handling the order of drillthrough columns -
02-18-2005
, 12:14 PM
I tested if I can handle the order of drillthrough columns through DSO
programming. Following is my sample.
----------------------------------------------------------------------------
---
Private Sub DrillThroughTest()
Dim dsoSvr As DSO.Server
Dim dsoDB As DSO.MDStore
Dim dsoCube As DSO.MDStore
Dim dsoPart As DSO.MDStore
Dim strDrillThroughColumns As String
Dim strDrillThroughFilter As String
Dim strDrillThroughFrom As String
Dim strDrillThroughJoins As String
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Connect to server
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set dsoSvr = New DSO.Server
dsoSvr.Connect "localhost"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' set db, cube and partition
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set dsoDB = dsoSvr.MDStores("Foodmart 2000")
Set dsoCube = dsoDB.MDStores("Sales")
Set dsoPart = dsoCube.MDStores("Sales")
strDrillThroughColumns = """store"".""store_id"",
""store"".""store_type"""
strDrillThroughFilter = ""
strDrillThroughFrom = """sales_fact_1997"", ""store"""
strDrillThroughJoins =
"(""sales_fact_1997"".""store_id""=""store"".""sto re_id"")"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' set drillthrough
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With dsoPart
.DrillThroughColumns = DrillThroughColumns
.DrillThroughFilter = DrillThroughFilter
.DrillThroughFrom = DrillThroughFrom
.DrillThroughJoins = DrillThroughJoins
.Update
End With
Set dsoPart = Nothing
Set dsoCube = Nothing
Set dsoDB = Nothing
dsoSvr.CloseServer
Set dsodvr = Nothing
End Sub
----------------------------------------------------------------------------
---
I tested two cases respectively.
First, strDrillThroughColumns = """store"".""store_id"",
""store"".""store_type"""
Second, strDrillThroughColumns = """store"".""store_type"",
""store"".""store_id"""
But when I execute drillthrough, the order of columns of result set is
always store_id, store_type.
Of course, I can refer to the fields of result set in the order that I want.
But it's not what I want. I heared that the order can be handled through DSO
programming.
What is wrong in my example?
Ohjoo Kwon
www.olapforum.com |