TM1 Web - Embed custom javascript

Post Reply
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

TM1 Web - Embed custom javascript

Post by vovanenok »

Hi guys

I'm looking the way to embed custom javascript into TM1 Web Report. My current goal is to use that javascript to hide particular columns ( something ala "column suppression" ), but of course it could bring much more extra functionality, especially different interactivity.
In TM1 Web I already found some aspx files where I can insert my javascript and it works fine after. The only thing is TM1 Web refreshes the report when you switch from one tab to another one, which should be resolved by adding custom listeners.
Just to avoid reinventing the wheel, maybe someone already has something and I would appreciate sharing such code.
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TM1 Web - Embed custom javascript

Post by tomok »

vovanenok wrote:Hi guys

I'm looking the way to embed custom javascript into TM1 Web Report. My current goal is to use that javascript to hide particular columns ( something ala "column suppression" ), but of course it could bring much more extra functionality, especially different interactivity.
In TM1 Web I already found some aspx files where I can insert my javascript and it works fine after. The only thing is TM1 Web refreshes the report when you switch from one tab to another one, which should be resolved by adding custom listeners.
Just to avoid reinventing the wheel, maybe someone already has something and I would appreciate sharing such code.
First off, TM1Web, as of 10.2, is no longer ASP driven, it's Java. You would have to hack the java code behind TM1 Web to do this. I doubt anyone would tackle something like that except maybe just for kicks.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
Harvey
Community Contributor
Posts: 236
Joined: Mon Aug 04, 2008 4:43 am
OLAP Product: PA, TM1, CX, Palo
Version: TM1 8.3 onwards
Excel Version: 2003 onwards
Contact:

Re: TM1 Web - Embed custom javascript

Post by Harvey »

If your main purpose is to hide columns, there might be better ways to do this.

I doubt that hacking the TM1Web aspx files (if you're on an older version) or the Java files would end up being a robust solution, even if you could get it to work in the version of TM1Web you are running.

If you determine that you absolutely need custom javascript, you might want to investigate implementing a browser add-in that can inject script and html into the TM1Web page on the fly. If you write it to degrade gracefully, at least you won't get errors when the version of TM1 is upgraded later.
Take your TM1 experience to the next level - TM1Innovators.net
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: TM1 Web - Embed custom javascript

Post by vovanenok »

Harvey wrote:If your main purpose is to hide columns, there might be better ways to do this.

I doubt that hacking the TM1Web aspx files (if you're on an older version) or the Java files would end up being a robust solution, even if you could get it to work in the version of TM1Web you are running.

If you determine that you absolutely need custom javascript, you might want to investigate implementing a browser add-in that can inject script and html into the TM1Web page on the fly. If you write it to degrade gracefully, at least you won't get errors when the version of TM1 is upgraded later.
Harvey, that would very interesting to hear about any way for column suppression
I think Browser add-in will cause the same troubles with new TM1 versions, plus I will need to care extra about browser versions.
tomok wrote: First off, TM1Web, as of 10.2, is no longer ASP driven, it's Java. You would have to hack the java code behind TM1 Web to do this. I doubt anyone would tackle something like that except maybe just for kicks.
Oh yes, I have 10.1 at my current project, so will need to look at 10.2 files.

But anyway, it sounds like we are talking about what IBMers should do and I hope we will get "column suppression" soon
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TM1 Web - Embed custom javascript

Post by tomok »

vovanenok wrote:But anyway, it sounds like we are talking about what IBMers should do and I hope we will get "column suppression" soon
There already is a way to suppress columns in a cube view under TM1 Web. You can either enable zero suppression (if that is why you don't want the column to show), or you create a subset on the column dimension to not show only the elements you want. If that won't work, because you have, for example, stacked dimensions on the columns, then your only real alternative is to create the view in Excel that configures things as you want and then publish that to TM1 Web.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: TM1 Web - Embed custom javascript

Post by vovanenok »

tomok wrote:
vovanenok wrote:But anyway, it sounds like we are talking about what IBMers should do and I hope we will get "column suppression" soon
There already is a way to suppress columns in a cube view under TM1 Web. You can either enable zero suppression (if that is why you don't want the column to show), or you create a subset on the column dimension to not show only the elements you want. If that won't work, because you have, for example, stacked dimensions on the columns, then your only real alternative is to create the view in Excel that configures things as you want and then publish that to TM1 Web.
Hi tomok, could you please share more details. Let's say I have an active form report which is basically dynamic rows with option to suppress rows with 0s.
But how to suppress columns with 0s? or any way to have dynamic columns: for some conditions I wanna show you only columns 5-10 instead of all 1-10?

Even more wondering to do the same with a static report...
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: TM1 Web - Embed custom javascript

Post by declanr »

You can create an MDX subset on the server, filtered by cube value isn't 0. Then just use subnms 1, 2, 3... etc in the columns... once its greater than the SubSiz you use conditional formatting to hide the column.
Declan Rodger
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: TM1 Web - Embed custom javascript

Post by vovanenok »

declanr wrote:You can create an MDX subset on the server, filtered by cube value isn't 0. Then just use subnms 1, 2, 3... etc in the columns... once its greater than the SubSiz you use conditional formatting to hide the column.
Thanks declanr, could you please tell how to use conditional formatting to completely hide the column (not just make the content color as white)?
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
declanr
MVP
Posts: 1815
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: TM1 Web - Embed custom javascript

Post by declanr »

You can't but as far as a user is concerned its much the same thing, unless you have so many columns that you end up with endless blank dpace for scrolling. Thats the point in using a predefined MDX subset, so that it is only those at the far right that are hidden and nothing else.
Declan Rodger
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: TM1 Web - Embed custom javascript

Post by vovanenok »

I agree that approach works in many cases. But it would be great to have a simple flag in some top row to hide the columns completely and I hope we will get it finally from IBM. I don't see any technical difficulties to hide a table column in HTML or Java
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TM1 Web - Embed custom javascript

Post by tomok »

vovanenok wrote:I agree that approach works in many cases. But it would be great to have a simple flag in some top row to hide the columns completely and I hope we will get it finally from IBM. I don't see any technical difficulties to hide a table column in HTML or Java
Yeah, well I wouldn't hold my breath waiting on that. The lack of ability to zero-suppress columns in an active form has been universally recognized as one of it's biggest shortcomings ever since the feature was introduced almost 10 years ago (I may be exaggerating slightly but the point is they don't seem to have any intention of fixing it).
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
lotsaram
MVP
Posts: 3652
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TM1 Web - Embed custom javascript

Post by lotsaram »

What you are proposing and/or requesting reeks of a sledgehammer approach. When faced with a screw its best to reach for a screwdriver. TM1 web isn't the best web UI and is a long way from the perfect web development tool but it's still better to develop within the confines of what the tool provides. There is ample scope with the available tools of MDX, TI, action buttons and Conditional formatting to achieve the result you are seeking - at least from the user perspective as the user doesn't really care one way or the other if a column is genuinely collapsed or hidden. The main limitation is that doing this in tm1 web does require some work and coding and is therefore potentially maintenance heavy and more importantly from an application feature perspective it does require interactivity from the user to click an action button rather than being event driven on cell value change which I personally see as the bigger limitation.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
vovanenok
Posts: 88
Joined: Mon Jun 23, 2014 4:54 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: Office 365
Location: Toronto, Canada
Contact:

Re: TM1 Web - Embed custom javascript

Post by vovanenok »

hey lotsaram, I will disagree with you. In Cognos BI we have "html" element, we have stored procedure query subject, it allows to create really interesting UI solutions to manipulate with data while working within "BI" tool. Here I'm talking about the "ability" to do something, not about the general approach. And in case with column suppression, it must have been done earlier in native functionality.
----------
TeamOne Google Sheets add-on for IBM Planning Analytics
Let's connect on LinkedIn
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: TM1 Web - Embed custom javascript

Post by Alan Kirk »

vovanenok wrote:hey lotsaram, I will disagree with you. In Cognos BI we have "html" element, we have stored procedure query subject, it allows to create really interesting UI solutions to manipulate with data while working within "BI" tool. Here I'm talking about the "ability" to do something, not about the general approach. And in case with column suppression, it must have been done earlier in native functionality.
I'm not sure whether that last sentence was talking about Cognos BI or TM1, but in the case of TM1 yes, the functionality was (briefly) available in Dynamic Slices. (Born version 9.0, died version 9.1.) They were rather flakier than Active Forms, which doubtless contributed to them being put on a mountainside and exposed.

And of course there's our dear friend the In Spreadsheet Browser, which is so flaky that hardly anyone uses it and is once again on death row with 10.2.0 being really and truly the last version to ever, ever support it, if you ignore the ISB icon that I can see on the 10.2.2 ribbon tab. Of course they probably meant the last full version and maybe it won't be there in 10.3. Or maybe 11. We're not sure, but maybe. Or maybe it's just that if you're on 10.2.2 and ask a support question about the ISB you won't get an answer. Anyway, it does have zero suppressed columns. But since it's dead code walking (maybe) I wouldn't rely on them too much.

I can understand the appeal of dynamic columns, as long as it doesn't come without the ability to disable them. Personally I find active form's ability to define a report row using a combination of TM1's functions (whether part of the driver view or not, and whether from the same cube or not) and other Excel functions to be far more useful than dynamic columns would be. I wouldn't begrudge their (re)introduction as long as it's not at the expense of performance or stability, but I wouldn't be rushing to use them either. But that's just me.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply