1,dialog操作:放在任意地方,然后可以把从dialog得到的数据传递进来。比如哟个button的click()方法。
Dialog _dialog ;
DialogField _numberrecord ,_routeid,_qty;
HDSH_NumberModules _numbermodule ;
RouteOprId _rqid ;
HDSH_QtyInt _qtyint ;
;
_dialog = new Dialog("@SYS74469") ;
_numberrecord = _dialog.addFieldValue(typeid(HDSH_NumberModules),'',"@sys14018") ;
_routeid = _dialog.addFieldValue(typeid(RouteOprId),'',"@SYS4528") ;
_qty = _dialog.addFieldValue(typeid(HDSH_QtyInt),'1',"@SYS14578") ;
if(_dialog.run())
{_numbermodule = _numberrecord.value() ;
_rqid = _routeid.value() ;
_qtyint = _qty.value() ;}
2,取多行数据
Args args = new Args() ;
Common common;
HDSH_MouldChangeHist _mouldchangelist ;
List _list = new List(types::String) ;
;
super();
args.caller(this) ;
for (common = HDSH_MouldChangeHist_ds.getFirst(true) ?HDSH_MouldChangeHist_ds.getFirst(true) : HDSH_MouldChangeHist_ds.cursor(); common; common =HDSH_MouldChangeHist_ds.getNext())
{
if(common.tableId == tableNum(HDSH_MouldChangeHist))
{
_mouldchangelist = common;
_list.addEnd( _mouldchangelist.ProdId) ;//把多选的数据放在list里面,可以是两维,list支持这样
}}
args.parmObject(_list) ; //HDSH_MouldChangeMN
new MenuFunction(menuitemoutputstr(HDSH_MouldChangeMN), MenuItemType::Output).run(args); //把list传递到这个menuitem对应的报表上。
在报表上取list数据:
报表的init方法:
public void init()
{
;
_list = element.args().parmObject() ; //parmobject传递list对象
if(!_list)
_list = new List(types::String) ;
super();
}
报表打印:
public boolean fetch()
{
boolean ret;
HDSH_MouldChangeHist _tblMCH ;
ListEnumerator le = new ListEnumerator() ;
str 20 _number ;
;
ret = super();
totalLaborTime = 0 ;
totalMachTime = 0 ;
le = _list.getEnumerator() ;//通过ListEnumerator 取值
while(le.moveNext()) //取值
{
_linenum=0 ;
totalLaborTime = 0 ;
totalMachTime = 0 ;
_number = le.current() ; //取当前传递出来的值
while select _tblMCH where _tblMCH.ProdId ==_number
{
_linenum++ ;
_prodid = _number ;
_MCName = _tblMCH.HDSH_ChangeMouldName;
_mcLaborTime = _tblMCH.MouldChangeTime * _tblMCH.Technicians ;
_mcMachTime = _tblMCH.MouldChangeTime ;
_workerqty = _tblMCH.Technicians;
_remark = _tblMCH.Remark ;
totalLaborTime += _mcLaborTime ;
totalMachTime += _mcMachTime ;
this.send(_tblMCH);
}
//element.execute(0);
element.execute(1);
element.execute(2);
element.execute(3);
element.execute(4);
element.execute(5);
//this.print() ;
element.newPage(); //打印所有选中的记录:类似多份
}
return ret;
}
将新增记录增加到当前过滤过的记录中
HDSH_MouldChangeHist_ds.refresh();
HDSH_MouldChangeHist_ds.research() ;