Export or Save a Data Table as an Image FileI can see how to readily create an image file from a graph. Is it possible to do the same with a data table?
Automation and ScriptingRe: Export or Save a Data Table as an Image FileLooks like I can do this from Journal. Just need a means to make the code generic to any table?
Re: Export or Save a Data Table as an Image FileHi @SpannerHead ,
Here's a generic JSL that will work with any table by sending it over to a journal and saving as you've requested. I've added a prompt at the start so you can pick where you want the file to save.
pickdir=pick directory();//pick where you want your file to go
dt=current data table();
nw = New Window( "data table journal",<<JOURNAL></JOURNAL>
Thanks,
Ben
Re: Export or Save a Data Table as an Image FileBen
Clever script! Only remaining issue is that the resulting Journal loses all it's formatting from the original table. The original had a lot of colouration indicating pass or fail.
Re: Export or Save a Data Table as an Image FileHi @SpannerHead,
Gotcha, let's try it a different way:
pickdir=pick directory();//pick where you want your file to go
dt=current data table();
//clear selections - if the selected column is left it will only bring that column into the journal
dt<<CLEAR select=""></CLEAR>
Thanks,
Ben
Re: Export or Save a Data Table as an Image FileBen
That works! Mighty!
Re: Export or Save a Data Table as an Image FileYou can also << get as report + << get picture (<< Get As Report can be helpful in many other places also not just here)
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
r = dt << Get As Report;
img = r << Get Picture;
img << Save Image("$TEMP/pic.png", "png");
Open("$TEMP/pic.png");
If you wish to access the table box which << get as report does create, you can use << Child on the created display box (it is a border box on highest level)
View more...
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
r = dt << Get As Report);
tb = r << child;
tb << Set Title Font Style("Bold");
img = tb << Get Picture;
img << Save Image("$TEMP/pic.png", "png");
Open("$TEMP/pic.png");
Write();
or data table box (this won't support coloring)
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
r = Data Table Box(dt);
img = r << Get Picture;
img << Save Image("$TEMP/pic.png", "png");
Open("$TEMP/pic.png");