Hi everyone,
I have a question about saving a dashboard as a PNG in JMP 16. I found an example in an old question, but it doesn't work for me.
I received this response:
Unresolved name: dash at line 13 while accessing or evaluating "dash", dash/*###*/
at line 440 in D:\Project JMP\Scripts\PourcentageDeNokParJour.jsl.
results_table = Open( "D:/Project JMP/Tables Resultats NOK percentages/Results.jmp" );
dash = JMP App(
Set Name( "Tableau de bord" ),
Set Description( "Description" ),
Auto Launch( 1 ),
Snap To Grid( 1 ),
Show Grid( 1 ),
Show Properties( 0 ),
Show Sources( 1 ),
Group By Category( 0 ),
Dashboard Mode( 1 ),
Parameters,
Tables(
DataTable1 = GuiTable(
Set Path(
"/D:/Project JMP/Tables Resultats NOK percentages/Results.jmp"
),
Set Label( "Results" ),
Location( "Current Data Table" ),
Invisible( 0 )
)
),
Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.
) ),
Allocate(
Module1 = Plan(
PreAllocate,
Script(JSL Quote(// This script is executed when a new module instance is
// created. The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created. Variables declared here are
// scoped to the ModuleInstance namespace.
// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);
thisModuleInstance << Create Objects;
// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").
Try(TabPage3 << Set Scriptable Object(thisApplication));
) ),
Allocate(
TabPage3 = Tab Page Box();
Splitter1 = H Splitter Box();
TabPage1 = Tab Page Box();
Scroll1 = Scroll Box();
Report1 = Platform(
DataTable1,
Graph Builder(
Size( 815, 650 ),
Show Control Panel( 0 ),
Fit to Window,
Variables(
X( :Date ),
Y( :Percent NOK ICT ),
Y( :Percent NOK FCT )
),
Elements( Position( 1, 1 ), Line( X, Y, Legend( 13 ) ) ),
Elements( Position( 1, 2 ), Line( X, Y, Legend( 14 ) ) ),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text(
"Percent NOK ICT & FCT par rapport à Date"
)}
)
)
)
);
TabPage2 = Tab Page Box();
Scroll2 = Scroll Box();
Report2 = Platform(
DataTable1,
Graph Builder(
Size( 851, 698 ),
Show Control Panel( 0 ),
Fit to Window,
Variables(
X( :Date ),
Y( :Total ICT ),
Y( :NOK ICT, Position( 1 ) ),
Y( :Total FCT ),
Y( :NOK FCT, Position( 2 ) )
),
Elements(
Position( 1, 1 ),
Bar(
X,
Y( 1 ),
Y( 2 ),
Legend( 11 ),
Label( "Label by Value" )
)
),
Elements(
Position( 1, 2 ),
Bar(
X,
Y( 1 ),
Y( 2 ),
Legend( 6 ),
Label( "Label by Value" )
)
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text(
"NOK ICT et FCT / Total ICT et FCT par rapport à Date"
)}
)
)
)
);
),
Organize(
Reparent( Scroll2( Report2 ) );
Reparent( TabPage2( Scroll2 ) );
Reparent( Splitter1( TabPage2 ) );
Reparent( Scroll1( Report1 ) );
Reparent( TabPage1( Scroll1 ) );
Reparent( Splitter1( TabPage1 ) );
Reparent( TabPage3( Splitter1 ) );
Relocate( TabPage3( 0, 0 ) );
),
Initialize(
TabPage3 << Background Color( 2147483647 ),
TabPage3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage3 << Enabled( 1 ),
TabPage3 << Horizontal Alignment( "Default" ),
TabPage3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage3 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
), TabPage3 << Text Color( 2147483647 ), TabPage3 << UI Only( 0 ),
TabPage3 << Vertical Alignment( "Default" ),
TabPage3 << Visibility( "Visible" ),
TabPage3 << Set Min Size( 442, 139 ),
TabPage3 << Set Max Size( 30000, 30000 ),
TabPage3 << Set Stretch( {"Neutre", "Neutre"} ),
TabPage3 << Title( "Total Production % & NOK % Dashboard" ),
TabPage3 << Tip( "" ), TabPage3 << Icon( "" ),
TabPage3 << Closeable( 0 ), TabPage3 << Moveable( 0 ),
TabPage3 << Set Base Font( "Texte" ),
TabPage3 << Set Font Scale( 1 ),
Splitter1 << Background Color( 2147483647 ),
Splitter1 << Border(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
), Splitter1 << Enabled( 1 ),
Splitter1 << Horizontal Alignment( "Default" ),
Splitter1 << Margin(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
),
Splitter1 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
), Splitter1 << Text Color( 2147483647 ), Splitter1 << UI Only( 0 ),
Splitter1 << Vertical Alignment( "Default" ),
Splitter1 << Visibility( "Visible" ), Splitter1 << Dockable( 1 ),
Splitter1 << Set Width( 1908 ), Splitter1 << Set Height( 728 ),
Splitter1 << Set Sizes( {0.502347417840376, 0.497652582159624} ),
Splitter1 << Set Min Size( 442, 113 ),
Splitter1 << Set Max Size( 60003, 30000 ),
Splitter1 << Set Stretch( {"Fenêtre", "Fenêtre"} ),
Splitter1 << set horizontal( 1 ),
TabPage1 << Background Color( 2147483647 ),
TabPage1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage1 << Enabled( 1 ),
TabPage1 << Horizontal Alignment( "Default" ),
TabPage1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage1 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
), TabPage1 << Text Color( 2147483647 ), TabPage1 << UI Only( 0 ),
TabPage1 << Vertical Alignment( "Default" ),
TabPage1 << Visibility( "Visible" ),
TabPage1 << Set Min Size( 241, 102 ),
TabPage1 << Set Max Size( 30000, 30000 ),
TabPage1 << Set Stretch( {"Neutre", "Neutre"} ),
TabPage1 << Title( "Constructeur de graphiques" ),
TabPage1 << Tip( "" ), TabPage1 << Icon( "Trellis" ),
TabPage1 << Closeable( 1 ), TabPage1 << Moveable( 1 ),
TabPage1 << Set Base Font( "Texte" ),
TabPage1 << Set Font Scale( 1 ),
Scroll1 << Background Color( 2147483647 ),
Scroll1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll1 << Enabled( 1 ),
Scroll1 << Horizontal Alignment( "Default" ),
Scroll1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll1 << Text Color( 2147483647 ), Scroll1 << UI Only( 0 ),
Scroll1 << User Resizable( {1, 1} ),
Scroll1 << Vertical Alignment( "Default" ),
Scroll1 << Visibility( "Visible" ),
Scroll1 << Set Min Size( 241, 76 ),
Scroll1 << Set Max Size( 30141, 30001 ),
Scroll1 << Set Stretch( {"Fenêtre", "Fenêtre"} ),
Scroll1 << Width( 956 ), Scroll1 << Height( 702 ),
Scroll1 << Set Auto Scrollable( 1 ),
Scroll1 << Set Scrollers( 0, 0 ), Scroll1 << Set Show Empty( 0 ),
Scroll1 << Set Clip Printing( 0 ),
Report1 << Background Color( 2147483647 ),
Report1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report1 << Enabled( 1 ),
Report1 << Horizontal Alignment( "Default" ),
Report1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report1 << Text Color( 2147483647 ), Report1 << UI Only( 0 ),
Report1 << Vertical Alignment( "Default" ),
Report1 << Visibility( "Visible" ),
Report1 << Set Min Size( 241, 76 ),
Report1 << Set Max Size( 30141, 30001 ),
Report1 << Set Stretch( {"Neutre", "Neutre"} ),
Report1 << set horizontal( 0 ),
TabPage2 << Background Color( 2147483647 ),
TabPage2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage2 << Enabled( 1 ),
TabPage2 << Horizontal Alignment( "Default" ),
TabPage2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
TabPage2 << Padding(
{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
), TabPage2 << Text Color( 2147483647 ), TabPage2 << UI Only( 0 ),
TabPage2 << Vertical Alignment( "Default" ),
TabPage2 << Visibility( "Visible" ),
TabPage2 << Set Min Size( 198, 113 ),
TabPage2 << Set Max Size( 30000, 30000 ),
TabPage2 << Set Stretch( {"Neutre", "Neutre"} ),
TabPage2 << Title( "Constructeur de graphiques" ),
TabPage2 << Tip( "" ), TabPage2 << Icon( "Trellis" ),
TabPage2 << Closeable( 1 ), TabPage2 << Moveable( 1 ),
TabPage2 << Set Base Font( "Texte" ),
TabPage2 << Set Font Scale( 1 ),
Scroll2 << Background Color( 2147483647 ),
Scroll2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll2 << Enabled( 1 ),
Scroll2 << Horizontal Alignment( "Default" ),
Scroll2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Scroll2 << Text Color( 2147483647 ), Scroll2 << UI Only( 0 ),
Scroll2 << User Resizable( {1, 1} ),
Scroll2 << Vertical Alignment( "Default" ),
Scroll2 << Visibility( "Visible" ),
Scroll2 << Set Min Size( 198, 87 ),
Scroll2 << Set Max Size( 30098, 30001 ),
Scroll2 << Set Stretch( {"Fenêtre", "Fenêtre"} ),
Scroll2 << Width( 949 ), Scroll2 << Height( 702 ),
Scroll2 << Set Auto Scrollable( 1 ),
Scroll2 << Set Scrollers( 0, 0 ), Scroll2 << Set Show Empty( 0 ),
Scroll2 << Set Clip Printing( 0 ),
Report2 << Background Color( 2147483647 ),
Report2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report2 << Enabled( 1 ),
Report2 << Horizontal Alignment( "Default" ),
Report2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
Report2 << Text Color( 2147483647 ), Report2 << UI Only( 0 ),
Report2 << Vertical Alignment( "Default" ),
Report2 << Visibility( "Visible" ),
Report2 << Set Min Size( 198, 87 ),
Report2 << Set Max Size( 30098, 30001 ),
Report2 << Set Stretch( {"Neutre", "Neutre"} ),
Report2 << set horizontal( 0 )
)
)
),
Initialize(
Module1 << Auto Launch( 1 );
Module1 << Set Module Type( "Report" );
Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
)
) << Run
NokBoard = dash << Get Windows;
NokBoard << Save Picture ("D:\Project JMP\DashBoards\ProductionPercent-NokPercent_DashBoard_of_"||current_month||".png", "png");
Thank you in advance,
Best regards,
Yass