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
twaintwist
Level III

Save small datatable to Journal

I've been at this for a while and I know it's doable but I can't seem to get it to work....

I can save my Graphs to a journal but can't append a small data table (summary table) to the journal.....  --- any hints?

9 REPLIES 9

Re: Save small datatable to Journal

Highlight the cells you want in the table, or select everything, then hit Crtl-J or Edit--> Journal.  The selected cells should show up in the Journal with column headers.

twaintwist
Level III

Re: Save small datatable to Journal

Thanks ---- I should have been more clear in my need ---- I need to save the Datatable to a journal using a script....

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Save small datatable to Journal

 

dt = Open( "$ENGLISH_SAMPLE_DATA/Big Class.jmp" ) << Summary( Group( :Age ), Mean( :Height ) );
dt << journal;

Works in JMP 9 & 10, possibly also in older versions.

Heidi
Level II

Re: Save small datatable to Journal

Hi,

Your solution works. However do you know a way to give that journal a name then I can append other graphs in the same journal?

 

Thanks!

txnelson
Super User

Re: Save small datatable to Journal

dt = Open( "$ENGLISH_SAMPLE_DATA/Big Class.jmp" ) << Summary( Group( :Age ), Mean( :Height ) );
xx = New Window( "my journal", <<journal );
dt << journal;

This is all covered in the Scripting Guide.  I strongly encourage you to read through it

     Help==>Books==>Scripting Guide 

Jim

Re: Save small datatable to Journal

I am already making an dt and journal it.

 

But now I want to make the table readable and comprehensive. There for I formatted my dt with :

dt << Set Cell Height( 100 );

and

dt6:Item << Set Display Width( 70 );
dt6:CaseUD << Set Display Width( 60 );
dt6:RAMS state << Set Display Width( 300 );
dt6:N Rows << Set Display Width( 40 );

......

The table looks good now, but when I do

dt6 << Journal();

The table in the journal will be without the formatting above. I tried a lot of options but can't find a way to get my formatted table into the journal.

 

Any ideas?

 

jthi
Super User

Re: Save small datatable to Journal

When you append datatable to a journal, it will be converted to Table Box with different type col boxes, widths don't seem to get copied over and you cannot have multiple lines in "normal" type col boxes. You can try to use some weird workaround like this, where you edit the table box and add extra column to it (col box can have multiple lines...)

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

jrn = Current Journal();

dt << journal;

Column(dt, "name") << Set Display Width(150);
dt << Set Cell Height(100);

rep = dt << get as report;
tb = rep[TableBox(1)];
tb[1] << Set Width(150);
tb << Append(cb_hidden = Col Box("hidden", Text Box("", << Set N Lines(2))));
cb_hidden << Visibility("Hidden");

rep << journal;

jthi_0-1699546002389.png

 

There are hopefully better methods than this.

-Jarmo

Re: Save small datatable to Journal

Hi Jarmo,

 

Thanks for sharing this work around. This is something to try to embed in my script.

 

In addition, I have one column with more text. Here I use code below to make it wrap. There is no function to do that unfortunately.

 

dt10 << New Column( "UD event" );
:UD event << Data Type( "Character" );
dt10 << Begin Data Update;
		For each row( 
			Wstate = Words( :Reason, "/" );
			:UD event =  Wstate;		);   //:RAMS state short = Concat Items( Wstate, "," );
dt10 << End Data Update;
dt10 << Delete Columns( :Reason );
jthi
Super User

Re: Save small datatable to Journal

How do you want the text to wrap? If you have text data using Col Box(Text Box()) combination should be able to meet most of the needs for text data. If you want it to wrap on specific character it can be more difficult.

Names Default To Here(1);
win = New Window("Example", fontobj = text = Text Box("Example Text"));
text << Set Wrap(50);

Providing some small sample or mock-up data (if you cannot share real-data) which shows the issues you are facing, will most likely make it easier to provide you better instructions. Also if possible provide screenshot about how you would like the data to look like.

-Jarmo