Page 1 of 1

TM1 and Javascript

Posted: Thu Mar 31, 2011 2:32 pm
by aking
I've done some searching for this, but couldn't seem to pull up anything worthwhile.

I have an HTML page that is simply HTML/CSS/JS and I'm looking for a way to read and write to a TM1 cube, using just these technologies, or also VBScript. Is this even possible?

If it's not possible, what would I need to add in order to make it possible?

Any help you can provide would be great. Thanks in advance.

Re: TM1 and Javascript

Posted: Thu Mar 31, 2011 3:38 pm
by blackhawk
Yes, it is possible, but it will require a third party product called Enterprise Services.

You can find out more about it by looking at this posting (http://www.tm1forum.com/viewtopic.php?f=20&t=3970) in the commercial section or you can write me a PM and I can give you more details.

Re: TM1 and Javascript

Posted: Thu Mar 31, 2011 7:56 pm
by Alan Kirk
aking wrote:I've done some searching for this, but couldn't seem to pull up anything worthwhile.

I have an HTML page that is simply HTML/CSS/JS and I'm looking for a way to read and write to a TM1 cube, using just these technologies, or also VBScript. Is this even possible?

If it's not possible, what would I need to add in order to make it possible?

Any help you can provide would be great. Thanks in advance.
Have you discounted using TM1 Web itself for this? I'm not the greatest fan of the product, but it does provide web functionality with a zero footprint.

Re: TM1 and Javascript

Posted: Thu Mar 31, 2011 8:17 pm
by George Regateiro
Outside of a thrid party tool or TM1 Web another option is to invest alot of time building some .net code around the vb api and then writing some aspx pages to handle the UI. Like Alan said if TM1 Web is an option it would certainly be the quickest and easiest.


The .net API is all but abandoned by IBM so starting any new development in that would not be horribly advisable.

Re: TM1 and Javascript

Posted: Thu Mar 31, 2011 8:30 pm
by aking
I doubt we can use TM1 web. The project is supposed to end up with a webpage that has an EV view on the bottom, and the top will do some workflow stuff that talks with TM1.

I've abandoned the Flat file idea, and am now going with an active server page. Haven't decided yet on C# or VB.

Re: TM1 and Javascript

Posted: Thu Mar 31, 2011 8:48 pm
by lotsaram
Rather than stuffing around with lots of custom development it seems to me you can meet your requirements with nothing more than a frame to hold the EV view and another frame using the TM1Web URL API ...

Re: TM1 and Javascript

Posted: Sat Apr 02, 2011 12:02 pm
by yyi
if you're not feeling sleepy one night, you could try this;

Login.aspx.cs

Code: Select all

        protected int tm1Main()
        {
            String adminHost, tm1Svr, tm1Uid, tm1Pwd;
            adminHost = TextBox1.Text;
            tm1Svr = TextBox2.Text;
            tm1Uid = TextBox3.Text;
            tm1Pwd = TextBox4.Text;
            int nRtn = 0;

            // Start by creating an Admin Server object 
            TM1AdminServer admin = new TM1AdminServer(adminHost, "tm1adminserver");

            try
            {
                // Obtain "sdata" server info object and then login 
                TM1Server server = admin.Servers[tm1Svr].Login(tm1Uid, tm1Pwd);

                if (server != null)
                {
                    Session["Default_txtAdminHost"] = TextBox1.Text;
                    Session["Default_txtServer"] = TextBox2.Text;
                    Session["Default_tm1Uid"] = TextBox3.Text;
                    Session["Default_tm1Pwd"] = TextBox4.Text;
                    string[] cs = {tm1Uid, "Web Home Page Object"};
                    TM1Cell cCell = server.Cubes["}ClientSettings"].Cells[cs];
                    Session["Default_Page"] = cCell.Value;
                }
                else
                {
                    // Handle failure to login 
                    nRtn = -1;

                    admin.LogoutAll();
                    admin.Dispose();
                    return nRtn;
                }
            }
            catch (Exception exc)
            {
                // Handle exception 
                nRtn = -2;
                admin.LogoutAll();
                admin.Dispose();
                string MainString = exc.Message;
                string SearchString = "-";
                string str1 = string.Empty;
                int FirstChr = MainString.IndexOf(SearchString);
                str1 = MainString.Substring(FirstChr + 1);
                if (str1.Substring(0, 6) != "Object")
                {
                    lblMessage.Text = str1;
                }
                else
                {
                    lblMessage.Text = "Invalid Host/Server";
                }
                return nRtn;
                //Response.Write("<script language='javascript'>window.alert('Connection Error - " +exc.Message +" ' );</script>");
                //MessageBox.Show("Login Failed:\n" + exc.Message, "TM1 API Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            // We're done with all database servers and the Admin Server object 
            admin.LogoutAll();
            admin.Dispose();
            return nRtn;
        }