Lo script seguente crea una finestra che l'utente deve selezionare le colonne specifiche che contengono ciascuna forma di mappa specifica per il veicolo. Da lì lo script è impostato per selezionare solo i punti di dati che sono rappresentati in ciascuna delle colonne e creare una nuova tabella di dati (dt1, dt2 e dt3). Il problema che sto avendo è che voglio usare la colonna selezionata nella prima finestra su dt come riferimento in dt1 per rappresentare graficamente quella colonna. Qualcuno sa come fare riferimento alla colonna selezionata della finestra in una tabella di dati collegata?
dt = Current Data Table();
If( Is Empty( dt ),
Try( dt = Open(), Throw( "No data table found" ) )
);
nc = N Col( dt );
lbWidth = 200;
custdial = New Window( "Type C Report",
H List Box(
H List Box(
Panel Box( "Select Columns", colListData = Col List Box( All, width( lbWidth ), nLines( Min( nc, 10 ) ) ) ),
V List Box(
Panel Box( "Left Side of Vehicle Column",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Left", colListL << Append( colListData << GetSelected ) ),
colListL = Col List Box( width( lbWidth ), minitems( 1 ), maxitems( 1 ), nLines( 1 ) )
)
),
Panel Box( "Right Side of Vehicle Column",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Right", colListR << Append( colListData << GetSelected ) ),
colListR = Col List Box( width( lbWidth ), minitems( 1 ), maxitems( 1 ), nLines( 1 ) )
)
),
Panel Box( "Top of Vehicle Column",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Top", colListT << Append( colListData << GetSelected ) ),
colListT = Col List Box( width( lbWidth ), minitems( 1 ), maxitems( 1 ), nLines( 1 ) )
)
)
),
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK", OKScript ),
Button Box( "Cancel",
custdial << CloseWindow;
Throw();
),
)
) // End of HListBox
) //end vlist box
);
OKScript = Expr(
custdial << CloseWindow;
<BR />//get the columm list
a = colListX;
dt = Current Data Table();
dt << Clear Row States;
dt << Select Where( :Measurement Location == "Top" );
dt1 = dt << Data View;
dt1 << Set Name( "Vehicle Top" );
r = dt1 << Select Where( :ED Pass Rate == "5. Point Not Measured" );
r << Hide and Exclude;<BR /><BR />//this line is where the code has a problem
graph1 = dt1 << Graph Builder(
Size( 873, 719 ),
Show Legend( 0 ),
Legend Position( "Bottom" ),
Variables( Color( :ED Pass Rate ), Shape( :Name( "a" ) ) ),
Elements( Map Shapes( Legend( 2 ), Show Missing Shapes( 1 ), Aspect Ratio( 1.02565192625141 ) ) ),
SendToReport(
Dispatch( {}, "", ScaleBox, {Label Row( Show Major Labels( 0 ) )} ),
Dispatch(
{},
"",
ScaleBox( 2 ),
{Min( 10.4984925982116 ), Max( 89.7351316066539 ), Inc( 10 ), Minor Ticks( 0 ), Label Row( Show Major Labels( 0 ) )}
),
Dispatch( {}, "graph title", TextEditBox, {Hide( 1 )} ),
Dispatch( {}, "Y title", TextEditBox, {Hide( 1 )} )
)
);
TopEDV = Report( graph1 )[Picture Box( 1 )];
TopEDV << save picture(
"S:\Material Quality\_Chemicals\Quality Assurance\Paint Film Build\Film Build Data Requests\04 Type C Audit\Working File\Top ED Vehicle.jpeg",
jpeg
);
);
@ alexhemmert1 :
Non sono sicuro di aver capito completamente la domanda, ma forse puoi provarlo?
dt = Current Data Table() ;
SelCol = dt << Get Selected Columns();
SelCol avrà il nome della colonna per la colonna che hai selezionato in dt che puoi usare.
Nota: non sembra esserci alcun testo evidenziato in rosso, quindi non sono sicuro di quale frammento di codice ti abbia dato un problema
Migliore
Uday