Get OLAP cube name

C

cottage6

Hello,
I'm not very experienced with OLAP cubes, but have been asked to see if
there's a way to get the name of the OLAP cube associated with a pivot table
in a spreadsheet. It looks to me like it's easy in Excel 2007 to see the
Workbook Connections, but I do not see a way in the earlier versions. Is
that correct, or is there a way to get the cube name? Unfortunatley, we have
users here on different Excel versions. Thanks!
 
M

Michael Wong

The code below is the core that you are in need. There may be mor
properties of the DataColumn that you need to look at, but this shoul
get you started.



Code Snippet

Dim svr As New Server

svr.Connect(".\sql05")

Dim db As Database

db = svr.Databases.GetByName("Adventure Works DW")

Dim dsv As DataSourceView = db.DataSourceViews.GetByName("Adventur
Works Dw")

Dim dimCust As Dimension = db.Dimensions.GetByName("Customer")

Dim attCust As DimensionAttribute = dimCust.Attributes(0)

Dim colBinding As ColumnBinding = CType(attCust.NameColumn.Source
ColumnBinding)

Dim col As Data.DataColumn
dsv.Schema.Tables(colBinding.TableID).Columns(colBinding.ColumnID)

Console.WriteLine(col.ExtendedProperties("ComputedColumnExpression"))


Still if you can't get it I would also recommend a book on OLAP an
believe me its pretty informative.
The 'book is available on Amazon ' (http://tinyurl.com/yelxeyd) & yo
can buy an e-book directly from the publisher by writin
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top