將表格輸出包括為電子郵件內容嗨,大家好!
有沒有辦法將表格輸出包含在電子郵件內容中?
我想要這樣的東西:
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 );
非常感謝你!
Re:將表格輸出包含為電子郵件內容您可以,但必須將其作為附件發送。Mail()的第三個參數應該是文本。
首先,保存Tabulate報告。如果收件人具有JMP,則可以將其另存為JMP報告或JMP日誌。如果沒有,請將其另存為圖片。然後使用保存文件的路徑作為Mail()中的第四個參數。
以下是將報告另存為圖片的示例:
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" );
如果您不想保留已保存的文件,則可以在使用“刪除文件”()刪除郵件後刪除腳本中的文件。
HTH,
梅蘭妮
Re:將表格輸出包含為電子郵件內容謝謝, @melaniedrake 梅蘭妮。我試圖避免將其作為附件發送,因為它會為電子郵件接收器帶來額外的操作,但我理解你的觀點。