以下是引用weiyisc在2022-8-1 08:04:35的发言:
VFP报表尝试过,确实不能设计出这种样式。
VFP报表尝试过,确实不能设计出这种样式。
可以通过报表的编程接口自己绘制,就看有无必要。
CREATE CURSOR bb (区县 c(10),类别 c(10),费用 I) CREATE CURSOR tt (区县 c(10),类别 c(10),费用 I) FOR i=1 TO 10 INSERT INTO tt VALUES ("区县"+TRANSFORM(i%2+1),"类别"+TRANSFORM(i%3+1),i%2+1) INSERT INTO tt VALUES ("区县"+TRANSFORM(i%3+1),"类别"+TRANSFORM(i%7+1),i%3+1) INSERT INTO tt VALUES ("区县"+TRANSFORM(i%5+1),"类别"+TRANSFORM(i%10+1),i%5+1) ENDFOR SELECT DISTINCT 区县 FROM tt INTO CURSOR tmp SCAN SELECT SPACE(10) 区县,类别,费用 FROM tt WHERE tt.区县==tmp.区县 INTO CURSOR tmp2 READWRITE SELECT " 小计" 类别,SUM(费用) 费用 FROM tmp2 INTO CURSOR tmp3 INSERT INTO tmp2 (类别,费用) SELECT * FROM tmp3 GO CEILING(RECCOUNT("tmp2")/2) IN "tmp2" REPLACE tmp2.区县 WITH tmp.区县 IN "tmp2" INSERT INTO bb SELECT * FROM tmp2 ENDSCAN SELECT " 合计" 区县,SUM(费用) 费用 FROM tt INTO CURSOR tmp3 INSERT INTO bb (区县,费用) SELECT * FROM tmp3 SELECT * FROM bb