建议首先增加单据备注。 用脚本数据量大,会很慢如下: int show_row_ext() { string v_id,v_no,sql; v_id=grid_get_v('MG','voucher_no',change_row_id); sql="select note_info from ebs_v where voucher_no='"+v_id+"'"; db_run(sql); v_no=db_res(0); grid_set_v('MG','v_note_info',change_row_id,v_no); return 1; }; 下面的脚本,数据超过600条又显示不齐 int load_over() { int i,x,n,y; string a,b,c,d,v_id,sql; v_id=''; n=grid_row_num("MG"); for(i=1;i<n;i++){ a=grid_get_v("MG","voucher_id",i-1); b=grid_get_v("MG","voucher_id",i); if(a!=b) v_id=v_id+grid_get_v("MG","voucher_id",i)+','; }; v_id=str_get_sub(v_id,0,strlen(v_id)-1); sql="select voucher_id,note_info from ebs_v where voucher_id in ("+v_id+")"; db_run(sql); y=db_row_count(); for(x=0;x<y;x++); { c=db_cell_ext("voucher_id",x); d=db_cell_ext("note_info",x); for(i=1;i<n;i++){ b=grid_get_v("MG","voucher_id",i); if(b==c) grid_set_v("MG","v_noteinfo",i,d); }; }; return 1; }; |