关于一对多报表动态数据实现的问题
我需要数据是动态地实现一对多报表,请问如何实现,昨天搞了一夜,还是弄不出来,请大师帮忙,要在报表HZ3实现报表HZ的效果
qq.rar
(8.38 KB)
[此贴子已经被作者于2021-7-13 08:21编辑过]
SELECT pz,yg FROM hz ORDER BY pz INTO CURSOR t1 SELECT * FROM mx INTO CURSOR t2 ORDER BY pz SELECT t2 SET ORDER TO TAG pz SELECT t1 SET RELATION TO pz INTO t2 IN t1 WITH this .InitialSelectedAlias="t1" .AddObject("cursor1","cursor") .cursor1.cursorsource="T1" .AddObject("cursor2","cursor") .cursor2.cursorsource="T2" .AddObject("RELATION1","RELATION") .relation1.childorder=pz .relation1.onetomany=.t. .relation1.relationalexpr=pz ENDWITH
Create Cursor t2 (pz c(40),hw c(40)) INSERT INTO t2(pz,hw) SELECT pz,hw FROM mx SELECT pz,yg FROM hz ORDER BY pz INTO CURSOR t1 SELECT t2 Index On pz Tag PZ2 SELECT t1 SET RELATION TO pz INTO t2 IN t1 WITH this .InitialSelectedAlias="t1" .AddObject("cursor1","cursor") .cursor1.cursorsource="T1" .AddObject("cursor2","cursor") .cursor2.cursorsource="T2" .AddObject("RELATION1","RELATION") .relation1.childorder="pz2" .relation1.onetomany=.t. .relation1.relationalexpr="pz" ENDWITH