Page 1 of 1

Actionbutton with more than one line

Posted: Fri Jan 15, 2021 11:41 am
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

Re: Actionbutton with more than one line

Posted: Fri Jan 15, 2021 3:35 pm
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...

Re: Actionbutton with more than one line

Posted: Wed Jan 20, 2021 8:15 am
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.

Re: Actionbutton with more than one line

Posted: Wed Jan 20, 2021 8:48 am
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.

Re: Actionbutton with more than one line

Posted: Wed Jan 20, 2021 2:56 pm
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.