Actionbutton with more than one line

Post Reply
User avatar
orlando
Community Contributor
Posts: 167
Joined: Fri Aug 04, 2017 8:27 am
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365

Actionbutton with more than one line

Post by orlando »

Hi!

I am in the process of revising some TM1 sheets.
Is it possible to force a line break on an action button?
For example, I have a report "Management report".
The button becomes very wide. I would rather have a square with two lines:
"Management
Report"
Is this possible with Perspectives and TM1Web or do I have to solve it with Pafe and a graphic above the button?

Thanks for any ideas!

Many greetings
orlando
User avatar
gtonkin
MVP
Posts: 1198
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Actionbutton with more than one line

Post by gtonkin »

Not sure that you can on the Perspectives based action buttons.
I have tried macro code to set the caption with a vbLF, vbCr and vbCRLF between words but the Action Button which appears to be an object in a drawing object does not seem to render this.

On PAfE, this seems to be easy to do - enter your text in a cell using Alt+Enter for the new line then copy contents of the cell to your Action Button.
Underlying objects are different which why it appears to work.

For interest I use the following code to loop through my Action Buttons and adjust sizes, positions etc.
You could tweak the to include TIButton.DrawingObject.Object.Caption to fiddle with the Caption

Code: Select all

Sub FormatTIButtons()
Dim TIButton as Variant
For Each TIButton In ActiveSheet.Shapes
    If TIButton.Type = 12 Then
        If Left(TIButton.OLEFormat.progID, 5) = "TM1XL" Then
    
            TIButton.Top = (TIButton.TopLeftCell.Height - TIButton.Height) / 2 + TIButton.TopLeftCell.Top
            TIButton.Left = TIButton.TopLeftCell.Left + 1
        
            TIButton.Width = iButtonWidth
            TIButton.Height = iButtonHeight
        End If
    End If
Next
End Sub
Note: I do have some constants defined for the button width and height.

Not sure that it will necessarily help you but you never know...
User avatar
orlando
Community Contributor
Posts: 167
Joined: Fri Aug 04, 2017 8:27 am
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365

Re: Actionbutton with more than one line

Post by orlando »

Hi,

thanks for your reply.
I give Pafe a try - have to change my main TM1 to Pafe/PAX till end of the year anyway....

Best regards
orlando

gtonkin wrote: Fri Jan 15, 2021 3:35 pm
On PAfE, this seems to be easy to do - enter your text in a cell using Alt+Enter for the new line then copy contents of the cell to your Action Button.
Underlying objects are different which why it appears to work.
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: Actionbutton with more than one line

Post by declanr »

Just a thought on this, in Perspectives can't you add an image as the background of an action button?
Create what you want the button to look like in Excel, take a screenshot and save it as an image and then try using that for the Action Button background.

I think it might still require you to put text in the button, so you could try a single dot and format it to be the same colour as the background behind it.
Declan Rodger
User avatar
garry cook
Community Contributor
Posts: 209
Joined: Thu May 22, 2008 7:45 am
OLAP Product: TM1
Version: Various
Excel Version: Various

Re: Actionbutton with more than one line

Post by garry cook »

Other option to render appropriately in TM1Web specifically is to do it in reverse and create a fully transparent Action button sized the same as the background image. Place this over the background image you want to use if you're dynamically changing the background icon or underlying text, etc.

Used that previously to make TM1 linked graphs "clickable" in Web to the end user to navigate through to related websheets. They have no idea they're hitting an action button, it worked quite well from a web front end POV for the user.
Post Reply