Page 1 of 1
TM1 API _VB functions in VWD2010
Posted: Wed Jun 20, 2012 11:54 pm
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.
Re: TM1 API _VB functions in VWD2010
Posted: Thu Jun 21, 2012 12:31 am
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#
Re: TM1 API _VB functions in VWD2010
Posted: Thu Jun 21, 2012 12:33 am
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
Re: TM1 API _VB functions in VWD2010
Posted: Thu Jun 21, 2012 2:00 am
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
Re: TM1 API _VB functions in VWD2010
Posted: Thu Jun 21, 2012 6:46 am
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.
Re: TM1 API _VB functions in VWD2010
Posted: Thu Jun 21, 2012 11:51 pm
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.
Re: TM1 API _VB functions in VWD2010
Posted: Fri Jun 22, 2012 3:08 pm
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?