cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
NetflixCrow956
Level III

how to enlarge columns

NetflixCrow956_0-1649051771760.png

Hello everyone, I'd like to enlarge my column with script. How to do it ? 

Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: how to enlarge columns

It turns out that "w" is coming back as zero, so the calculation in the Set Displa Width is zero.  Try changing it to something like

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
w = :Height << Get Display Width;
:Height << Set Display Width( 4 * 90 );
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: how to enlarge columns

Here is the example taken from the Scripting Index for the Set Display Width message

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
w = :Height << Get Display Width;
:Height << Set Display Width( 2 * w );
Jim
NetflixCrow956
Level III

Re: how to enlarge columns

When I paste the code, the width of the column it has not grown

txnelson
Super User

Re: how to enlarge columns

It turns out that "w" is coming back as zero, so the calculation in the Set Displa Width is zero.  Try changing it to something like

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
w = :Height << Get Display Width;
:Height << Set Display Width( 4 * 90 );
Jim
Craige_Hales
Super User

Re: how to enlarge columns

Here's a variation you might find useful

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
w = ((Text Box( dt:name[1], <<setbasefont( "datatable" ) ) << getpicture) << getsize)[1];
dt:name << Set Display Width( 1.2 * w );

 

Read the w= line from the inside -> out like this:

 

  • make a textbox with Katie and the data table font
  • get a picture of the textbox
  • get the size of the picture
  • get the x dimension of the size
  • use that for w, the width needed

 

I chose Katie in line 1 to make this picture. I added 20% to avoid "Ka...".

 

At some font sizes, 10% might not be enough.At some font sizes, 10% might not be enough.

Also, you can make a data table, change almost anything, and use the red triangle->copyTableScript(NoData) option to see how JMP scripts the changes. Paste the copy into an editor to see it.

 

 

Craige