Choose Language Hide Translation Bar
Highlighted
Aziza
Level III

Include the tabulate output as an Email content

Hi everyone!

Is there any way to include the tabulate output as the Email content?

I would like something like this: 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
tabResult = dt << Tabulate(
	Show Control Panel( 0 ),
	Show Shading( 0 ),
	Add Table( Row Table( Grouping Columns( :Name, :Age, :Height, :Weight ) ) )
);

// and include the tabResult as the content of the message:

Mail( "test@example.com", "subject A", tabRresult );

Thank you very much! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Include the tabulate output as an Email content

You can, but you must send it as an attachment. The third argument to Mail() should be text.

 

So first, save the Tabulate report. If the recipient has JMP, you can save it as a JMP report, or as a JMP Journal. If not, save it as a picture. Then use the path to the saved file as the fourth argument in Mail().

 

Here's an example saving the report as a picture:

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
tabResult = dt << Tabulate(
	Show Control Panel( 0 ),
	Show Shading( 0 ),
	Add Table( Row Table( Grouping Columns( :Name, :Age, :Height, :Weight ) ) )
);

// save the report as a picture
Report(tabResult) << Save Picture("$DESKTOP/tabulatePicture.png", "png");

// and include the tabResult as the content of the message:

Mail( "test@example.com", "subject A", "Here is the tabulate report.", "$DESKTOP/tabulatePicture.png" );

If you don't want to keep around the saved file, you can delete the file in the script after you sen the mail using Delete File().

 

HTH,

Melanie

View solution in original post

2 REPLIES 2
Highlighted

Re: Include the tabulate output as an Email content

You can, but you must send it as an attachment. The third argument to Mail() should be text.

 

So first, save the Tabulate report. If the recipient has JMP, you can save it as a JMP report, or as a JMP Journal. If not, save it as a picture. Then use the path to the saved file as the fourth argument in Mail().

 

Here's an example saving the report as a picture:

 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
tabResult = dt << Tabulate(
	Show Control Panel( 0 ),
	Show Shading( 0 ),
	Add Table( Row Table( Grouping Columns( :Name, :Age, :Height, :Weight ) ) )
);

// save the report as a picture
Report(tabResult) << Save Picture("$DESKTOP/tabulatePicture.png", "png");

// and include the tabResult as the content of the message:

Mail( "test@example.com", "subject A", "Here is the tabulate report.", "$DESKTOP/tabulatePicture.png" );

If you don't want to keep around the saved file, you can delete the file in the script after you sen the mail using Delete File().

 

HTH,

Melanie

View solution in original post

Highlighted
Aziza
Level III

Re: Include the tabulate output as an Email content

Thank you, @melaniedrake Melanie. I tried to avoid to send it as an attachment, since it will cause an extra action for the Email receivers, but I understand your point of view.

Article Labels

    There are no labels assigned to this post.