TM1 API _VB functions in VWD2010

Post Reply
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

TM1 API _VB functions in VWD2010

Post by PlanningDev »

Im trying to work with the .net API in Visual Web Developer 2010. I have been able to get the basic function of returning the number of servers on the admin host. The issue now is that when using the snippet of sample code

Code: Select all

TM1SystemServerName_VB(hUser, iServer, sDbName, 75)
during a loop nothing is returning. I know that in later versions of Visual Studio fixed length strings are not supported. Is this part of the problem?

Do I need to use <VBFixedString(75)> and if so, then how would Implement that as VS barks at me about not allowing attributes on local variables.

Any help would be appreciated.
User avatar
yyi
Community Contributor
Posts: 122
Joined: Thu Aug 28, 2008 4:42 am
Location: Sydney, Australia

Re: TM1 API _VB functions in VWD2010

Post by yyi »

There's a good tutorial in the 'Useful code, tips and tricks' section; http://www.tm1forum.com/viewtopic.php?f=21&t=3819
by Alan.

I found it easier using VS2010 with C#
Yeon
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

Re: TM1 API _VB functions in VWD2010

Post by PlanningDev »

I was hoping to use .net so I could create the web app. I used VB 2010 and it didn't seem to be an issue. In a .net web I cant seem to get return value from the _vb functions
User avatar
yyi
Community Contributor
Posts: 122
Joined: Thu Aug 28, 2008 4:42 am
Location: Sydney, Australia

Re: TM1 API _VB functions in VWD2010

Post by yyi »

VS2010 is .net, it also comes with VWD but i just used 'create new web app' which opens a new project using *.aspx
Yeon
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

Re: TM1 API _VB functions in VWD2010

Post by PlanningDev »

What I meant was that in VWD2010 which is .net, Fixed string lengths are not supported. However the TM1 API functions that end in _VB require a fixed string length when returning the VB string.

as stated above, Im able to get a the number of servers available back from the admin host, but looping those and trying to return the name is giving nulls.
User avatar
yyi
Community Contributor
Posts: 122
Joined: Thu Aug 28, 2008 4:42 am
Location: Sydney, Australia

Re: TM1 API _VB functions in VWD2010

Post by yyi »

Oh, sorry I only tried the C# syntax for looping thru server names using Applix.TM1.API.dll reference.
You should give it a go, it's a lot simpler and you can always change language setting to VB.net if you prefer.
Yeon
PlanningDev
Community Contributor
Posts: 349
Joined: Tue Aug 17, 2010 6:31 am
OLAP Product: Planning Analytics
Version: 2.0.5
Excel Version: 2016

Re: TM1 API _VB functions in VWD2010

Post by PlanningDev »

Does anyone have any sample code in vb.net using a later version like Visual Web Developer 2010? Also using TM1 version 9.5 or higher?
Post Reply