Navigate Application Folder via VB API

Post Reply
lemon103
Posts: 5
Joined: Tue Aug 04, 2009 3:38 pm
OLAP Product: TM1
Version: 9.4 MR1 FP2
Excel Version: 2007

Navigate Application Folder via VB API

Post by lemon103 »

Hey Guys,

I am looking for sample code to download and open Excel workbooks posted on the Application folder.
I have already figured out how to download a BLOB from the }Externals folder and open it as an Excel file if I know the filename.
But the problem is to figure out what the filename is in the first place.
I figured it has to do with these undocumented API calls:
Declare Function TM1Entry Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeFolder Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeCube Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeDimension Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeProcess Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeChore Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeView Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeSubset Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeBlob Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeExternal Lib "tm1api.dll" () As Long
Declare Function TM1EntryTypeFolderReference Lib "tm1api.dll" () As Long
Declare Function TM1ServerFolder Lib "tm1api.dll" () As Long
Declare Function TM1EntryType Lib "tm1api.dll" () As Long
Declare Function TM1EntryReference Lib "tm1api.dll" () As Long
Declare Function TM1EntryAdditionalProperties Lib "tm1api.dll" () As Long
Declare Function TM1FolderEntries Lib "tm1api.dll" () As Long

But I haven't been able to figure out how to use them yet. :(

Any help is appreciated !

Yan
User avatar
Mike Cowie
Site Admin
Posts: 483
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: Navigate Application Folder via VB API

Post by Mike Cowie »

Hi Yan,

I have not used these API calls before nor do I have any additional information, but if I had to guess I can take a stab based on what I know about other API functions:

1. TM1ServerFolder, when used with TM1OBjectPropertyGet and a handle to your server may get you a handle to the root of the application folders?

2. TM1FolderEntries, when used with the result of the TM1 server folder (a handle to this folder object perhaps) and TM1ObjectListCount and TM1ObjectListHandleByIndexGet will get you the number of child items of the root folder and each item based on index, respectively.

3. TM1EntryType() is probably something you'd use along with a valid handle to each "entry" item and the TM1ObjectPropertyGet function to find out what kind of entry you have. My guess is that the following are the possible type functions that you could compare the result against (the result is probably an Index type, but you can use TM1ValType to check whether that's true):
TM1EntryTypeFolder
TM1EntryTypeCube
TM1EntryTypeDimension
TM1EntryTypeExternal
TM1EntryTypeProcess
TM1EntryTypeChore
TM1EntryTypeView
TM1EntryTypeSubset
TM1EntryTypeBlob
TM1EntryTypeFolderReference

4. I would guess that TM1EntryAdditionalProperties is also used with TM1ObjectPropertyGet, but that it returns something like a string or an array of additional information about the actual object and its name, possibly file path, etc.

5. When you get an entry that's of type TM1EntryTypeFolder, I would imagine you need to use the same TM1ObjectListCountGet and TM1ObjectListHandleByIndexGet to get all the items that roll into that folder.

Outside of that, your guess is as good as mine. You can try asking IBM support for more information - they may be willing to share specifics. Or hopefully someone else here on the forum can help/has used these. I think there are definitely some gaps in what I've got above, but hopefully it helps in some way.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
lemon103
Posts: 5
Joined: Tue Aug 04, 2009 3:38 pm
OLAP Product: TM1
Version: 9.4 MR1 FP2
Excel Version: 2007

Re: Navigate Application Folder via VB API

Post by lemon103 »

You are totally correct.
I got it working now.
Thanks!
Post Reply