Le script ci-dessous crée une fenêtre dans laquelle l'utilisateur doit sélectionner les colonnes spécifiques contenant chaque forme de carte spécifique pour le véhicule. À partir de là, le script est configuré pour sélectionner uniquement les points de données représentés dans chacune des colonnes et créer un nouveau tableau de données (dt1, dt2 et dt3). Le problème que je rencontre est que je souhaite utiliser la colonne sélectionnée dans la première fenêtre de dt comme référence dans dt1 pour représenter graphiquement cette colonne. Est-ce que quelqu'un sait comment référencer la colonne sélectionnée de la fenêtre dans une table de données liée?
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 :
Je ne sais pas si j'ai bien compris la question, mais vous pouvez peut-être essayer?
dt = Current Data Table() ;
SelCol = dt << Get Selected Columns();
SelCol aura le nom de la colonne pour la colonne que vous avez sélectionnée dans dt et que vous pouvez utiliser.
Remarque: il ne semble pas y avoir de texte surligné en rouge - vous ne savez donc pas exactement quel fragment de code vous a posé problème
Meilleur
uday