我这有下面代码,当int_i=0时,弹出打印选择框,后面的自动按之前选择的印表机列印,
但是有一个问题,当第一次弹出打印选择框时,选择的是取消,后面的也会列印出来,不能怎么实现这个功能?
int_i:=0;
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').first;
while not InfoBroker2.Info.DataSetByID('cux_order_sign_detail').Eof do
begin
//打印
if int_i=0 then
begin
TSheetDoc(DocView1.Doc).Exporter.Print;
end;
if int_i<>0 then
begin
TSheetDoc(DocView1.Doc).Exporter.PrintEx(false,true);
end;
TSheetDoc(DocView1.Doc).Exporter.Print;
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').edit ;
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').FieldByName('picked_print').Asinteger:=(InfoBroker2.Info.DataSetByID('cux_order_sign_detail').FieldByName('picked_print').Asinteger +1);
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').FieldByName('picked_print_user').Asstring:=lsuser;
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').FieldByName('picked_print_date').Asstring:=Business.System.SysUtils.formatdatetime('yyyy-mm-dd hh:mm:ss',Business.System.SysUtils.Now);
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').next;
int_i:=int_i+1;
end;
InfoBroker2.Info.DataSetByID('cux_order_sign_detail').ApplyUpdates;