Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- JSL - Adding a Table to a Journal

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Nov 16, 2016 9:24 AM
(11513 views)

Another JSL question, I'm trying to put a table in Journal using JSL. Here is what I am trying to do:

current_data_table << New Data View; // Creating the Journal nw = New Window("Journal Right Here", <<Journal, ob = Outline Box("Section 1", Text Box("Some description that we need here.", << Markup), Current Journal()[TableBox(current_data_table)] ) );

Everything seems to be working but the TableBox code... I am sure it is something easy but it is stumping me.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is a very simple script that does what you want:

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
nw = New Window( "sample journal",
<<journal,
ob = Outline Box( "Selection 1",
Text Box( "this is some description", Markup( 1 ) ),
dt << New Data Box()
)
);
```

Jim

14 REPLIES 14

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here is a very simple script that does what you want:

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
nw = New Window( "sample journal",
<<journal,
ob = Outline Box( "Selection 1",
Text Box( "this is some description", Markup( 1 ) ),
dt << New Data Box()
)
);
```

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Hi Jim,

Thank you for your response. It works great. Quick question through, when I go to the Journal is shows the table with rows and columns that are completely empty (like an Excel spreadhseet) versus just the rows and column with headers. Any solutions?

Thank you in advance,

Brad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

The reason it displays empty cells, is because it is a view into an existing data table. Here is another script that just adds a visual copy. The script has to be a little tricky in it's method to place the data table view under the outline box.

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
nw = New Window( "sample journal",
<<journal,
ob = Outline Box( "Selection 1",
Text Box( "this is some description", Markup( 1 ) ),
hlb = H List Box()
)
);
xx = New Window( "xxx", <<journal );
dt << journal;
hlb << append( xx );
xx << close window;
```

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Awesome! Thank you so much for taking the time to reply, completely works.

Brad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Thanks for those last 4 lines.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Is it possible to append matrix to a display box without any for loop etc?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Append a matrix???

A mathematical matrix....... a = [1,2,3 4,5,6] ?

A matrix of text boxes?

Jim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

Yes, A 2D matrix of numbers. I was thinking if it can be converted as a table, can it be directly append to a display box?

Thanks

Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JSL - Adding a Table to a Journal

This might work for you

```
names default to here(1);
myMatrix = [1 2 3, 4 5 6, 7 8 9];
nw=new window("test", vlb=vlistbox());
vlb<<append((as table(myMatrix))<< get as report);
close(current data table(), nosave);
(nw<<xpath("//NumberColBox"))<<set heading("");
```

Jim