Scripting Guide > Extending JMP > JMP Live and JMP Public > Example of Publishing from Multiple Data Tables to JMP Live
Publication date: 08/13/2020

Example of Publishing from Multiple Data Tables to JMP Live

This example shows how to create multiple reports from two data tables and publish the reports to JMP Live.

publishUrl = "https://live.company.com:3501";
username = "xyz@jmp.com";
password = "test";
dtBigClass = Open( "$SAMPLE_DATA/Big Class.jmp" );
dtTitanic = Open( "$SAMPLE_DATA/Titanic Passengers.jmp" );
 
// create a Bivariate graph from Big Class.jmp
rpt1 = dtBigClass << Bivariate(
	Y( :weight ),
	X( :height ),
	Automatic Recalc( 1 ),
	Fit Line( {Line Color( {213, 72, 87} )} ),
	Local Data Filter( Add Filter( columns( :sex ) ) )
);
 
// create a Graph Builder graph from Titanic Passengers.jmp
rpt2 = dtTitanic << Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Passenger Class ), Y( :Survived ), Group X( :Sex ) ),
	Elements( Mosaic( X, Y, Legend( 4 ), Response Axis( "Y" ) ) ),
	SendToReport(
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				4,
				Properties( 0, {Fill Color( 72 )} ),
				Properties( 1, {Fill Color( 69 )} )
			)}
		),
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( "Survived vs. Passenger Class and Sex" )}
		)
	)
);
// create a Logistic graph from Big Class.jmp
rpt3 = dtBigClass << Logistic( Y( :age ), X( :weight ) );
 
webrpt = New Web Report();
webrpt << Add Report(
	rpt2,
	// the title that appears above the graph
	Title( "CRDO CHILD (1): Survivors by Class and Sex" ),
	Description( "CRDO: Titanic survival report, a.k.a., the unsinkable Molly Brown" )
);
webrpt << Add Image(
	"C:\Users\Public\JMP\Projects\WebJMP\Compound_Reports_DoOver\atlas.jpg",
	Title( "CRDO CHILD (2): Atlas" ),
	Description( "CRDO: Holding up the world as always." )
);
webrpt << Add Report(
	rpt3,
	Title( "CRDO CHILD (3): Big Class Logistic" ),
	Description( "CRDO: Logistic Regression Big Class keywords Michael, Ohio, mumps" )
);
webrpt << Add Report(
	rpt1,
	Title( "CRDO CHILD (4): Big Class Bivar" ),
	Description( "CRDO: Bivariate on Big Class, keywords Leonard, Michigan, chicken pox" )
);
url = webrpt << Publish(
	URL( publishUrl ),
	API Key ( APIkey),
	Username( username ),
	Password( password ),
	// create a folder and index page to group the reports
	Index(
		/* the title that appears above the report and on the browser tab,
		prepended to the graph title */
		Title( "CRDO FOLDER: Web Report Index Title Maryland Janice Polio" ),
		Description( "CRDO: Index description keywords Nebraska Richard Tetanus" )
	),
	Public( 1 )
);
 
Web( url );
 
rpt1 << Close Window();
rpt2 << Close Window();
Close( dtBigClass, NoSave );
Close( dtTitanic, NoSave );
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).
.