cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
YannickF
Level I

Change font size of table box in report

Hi all,

I am trying to change the font size of a table box that I generate inside a report. Is there such a function? I tried

<< Set Font Size (8)

but that doesn't seem to work...

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Change font size of table box in report

You'll need to use the col box display box inside of a table box to set the font size.

Names Default to Here( 1 );

New Window( "Col Box Font Size",
	table box(
		scb = Col Box( "Message")
	)
);

tb = {};
text_list = {"Hello, world!", "One Flew Over the Cuckoo's Nest", "Return to sender"};
for (i = 1, i <= nitems(text_list), i++,
	tb[i] = text box(text_list[i]);
	tb[i] << set font size(12);
	scb << append(tb[i]);
);

pmroz_0-1643902190303.png

 

View solution in original post

3 REPLIES 3

Re: Change font size of table box in report

You can search (filter) the view in the Scripting Index. This filter shows that the Display Boxes that respond to the << Set Font Size() message is limited:

 

Screen Shot 2022-02-03 at 9.48.25 AM.png

 

A Table Box does not include this message in its protocol. This sample script shows how it works with some of these display boxes:

 

Names Default to Here( 1 );

New Window( "Font Playground",
	Outline Box( "Text All Over the Place",
		tb = Text Box( "Hello, world!" ),
		teb = Text Edit Box( "Hello, world!" ),
		scb = String Col Box( "Message", { "Hello, world!" } ),
	)
);

Wait( 3 );

{ tb, teb, scb } << Set Font Size( 18 );
pmroz
Super User

Re: Change font size of table box in report

You'll need to use the col box display box inside of a table box to set the font size.

Names Default to Here( 1 );

New Window( "Col Box Font Size",
	table box(
		scb = Col Box( "Message")
	)
);

tb = {};
text_list = {"Hello, world!", "One Flew Over the Cuckoo's Nest", "Return to sender"};
for (i = 1, i <= nitems(text_list), i++,
	tb[i] = text box(text_list[i]);
	tb[i] << set font size(12);
	scb << append(tb[i]);
);

pmroz_0-1643902190303.png

 

YannickF
Level I

Re: Change font size of table box in report

Thank you, I got it to work now!