润乾打印标签横向扩展




  select (select count(id) from tms_elec_table where trans_code <= et.trans_code) as seq,

et.type as type,et.trans_code as trans_code,et.lot_no as lot_no,

temp.name as name,temp.code as tempCode,rt.code as lineCode,

to_char(et.date_1,'yyyyMMdd') as date_1

from tms_elec_table et

left join tms_receiver temp on temp.id=et.received_id

left join tms_route rt on rt.id=temp.route_id

where 1=1

order by seq,et.type,lineCode

A1:=ds1.count(),用于计算此数据集内的数据个数。

B1:=int(A1)/3+1,用于计算一共需要扩展的行数,其中”3″是每行的数据列数。

A3:=to(1,B1),作为强制分行的扩展基础。

B3:=(A3-1)*3,是每行的基数。

D2:=to(1,3),与B1统一,控制显示为5列数据,扩展方式为横向扩展

D3:=ds1.select1(type,seq==D2+B3) ,其中D2+B3分别递增,达到与每个seq进行匹配的目的,这里需要着重强调的是数据集里需要”seq”是连续递增的数字,来实现换行后的匹配。

D4:=ds1.select1(name,seq==D2+B3),把D4的上主格设置为E3。

D5: =ds1.select1(tempCode,seq==D2+B3),把D5的上主格设置为E3。

D6: =ds1.select1(seq,seq==D2+B3),D6扩展方式为横向扩展。

E3: =ds1.select1(trans_code,seq==D2+B3).

F5: ='批次'+ds1.select1(lot_no,seq==D2+B3),把F5的上主格设置为E3。

H3: =ds1.select1(seq,seq==D2+B3).

H4: =ds1.select1(lineCode,seq==D2+B3),把H4的上主格设置为E3。

H5: =ds1.select1(date_1,seq==D2+B3),把H5的上主格设置为E3。

粗略效果如下:



 

http://blog.sina.com.cn/s/blog_59def1cb0100gbka.html

猜你喜欢

转载自minyongcheng.iteye.com/blog/1097867