下面的脚本创建了一个窗口,用户必须选择保存车辆每个特定地图形状的特定列。从那里开始设置脚本以仅选择在每个列中表示的数据点并创建新的数据表(dt1,dt2和dt3)。我遇到的问题是我想使用在dt的第一个窗口中选择的列作为dt1中的参考来绘制该列。有谁知道如何在链接数据表中引用窗口选定列?
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 :
不确定我是否完全理解了这个问题,但也许你可以试试这个?
dt = Current Data Table() ;
SelCol = dt << Get Selected Columns();
SelCol将具有您在dt中选择的列的列名,您可以使用该列。
注意:似乎没有任何文本用红色突出显示 - 所以不确定哪个代码片段给你一个问题
最好
乌代