fastreport打印复杂报表,急呀! (200分)

  • 主题发起人 主题发起人 bjgdczl
  • 开始时间 开始时间
B

bjgdczl

Unregistered / Unconfirmed
GUEST, unregistred user!
本人用fastreport 打印多个表的数据,结构如下

--------------------------------------------------------------------------
表1的字段名....
--------------------------------------------------------------------------
表1的数据....
--------------------------------------------------------------------------
--------------------------------------------------------------------------
表2的字段名1 表3的字段名1 表2的字段名2 表3的字段名2...
--------- |---------------------------------------------------------------------
细项数据1 表2的数据1 表3的数据1 表2的数据2 表3的数据2...
--------- |---------------------------------------------------------------------
----------|---------------------------------------------------------------------
表2的字段名7 表3的字段名7 表2的字段名8 表3的字段名8...
----------|---------------------------------------------------------------------
细项数据2 表2的数据7 表3的数据7 表2的数据8 表3的数据8...
----------|---------------------------------------------------------------------
--------------------------------------------------------------------------
这里,表2、3都与表1的某字段关联,关联后表2、3都有几组数据与表1对应,
若细项数据1、2与表2对应,表2的数据正常,表3的数据不正常
若细项数据1、2与表3对应,表3的数据正常,表3的数据不正常
本人试图用交叉表数据做,但没能成功,请各位大虾指点,
急呀!本人在线等待。

 
用SQL把数据取出来,然后用分组打印行不行?
 
to whf :
怎么分组打印呢,能否再指点一下?
 
放个分组头Band,然后设置分组条件就行了。
 
to whf:
表2和表3是一个表用不同时间区分的clientdataset,比如表2对应本月,
表3对应上月,不知道分组条件如何设置,我刚才试了一下
还是不行呀,请大虾指点
 
这个分组字段应该是表1和表2,表3关联的字段(这两个关联字段是否相同)
如果用Master-detail报表,可以试试:
细项数据1、2与表2对应,在frReport1的Onbegin
Band中:
procedure TForm1.frReport1begin
Band(Band: TfrBand);
begin

if AnsiCompareText(Band.Name, 'DetailBand1') = 0 then

table3.Next;
// 手工移动表3的纪录
end;


 
谢谢,我试试看。
 
折腾好长时间,还是没有调通,whf,能否给个例子,再次感谢!
 
不好意思,方法有点问题(表2和表3有关系吗?),还是用主子表
在指向表2的frDBDataSet的事件中
procedure TForm1.frDBDataSetls2Next(Sender: TObject);
begin

Tablels3.Next;
end;


procedure TForm1.frDBDataSetls2First(Sender: TObject);
begin

Tablels3.First;
end;


procedure TForm1.frDBDataSetls2Prior(Sender: TObject);
begin

Tablels3.Prior;
end;


 
祝你调试成功

............."$$$$$$$o...................ooooo
.............."$$$$$$$$$o.........ooo$$$$$$$$$
.......ooo$$$$$$$$$$$$$$$....oo$$$$$$$$$$$"""
.......$$$$$$$$$$$$$$$$o....o$$$$$$$"""
.........$$$$$$$"""o$$$$$$...$$$$$$
..........$$$$$$..o$$$$$"....$$$$$
..........$$$$$$.o$$$$$".....$$$$$.....ooo.oo$$$o
...........$$$$$$$$$$$$$$...$$$$$"...o$$$$$$$$$$$$
.........oo$$$$$$$$$$$""....$$$$$$$$$$$$$$$$$$$$$$
........."$$$$$$$$$$$ooo....$$$$$$$$$$$$$$$$"
..........."""$$$$$$$$$$$o..$$$$$$$$$$$$$$$$
...........oo$$$$$$$$$$$$"..$$$$.....$$$$$$$
......oo$$$$$$$$$$$$$""....o$$$$.....$$$$$$$
.....$$$$$$$$$$$$$$$$oooo..$$$$$.....$$$$$$$
.....$$$$$$$"."$$$$$$$$$$$$$$$$".....$$$$$$$
......""$$$....$$$$$$."$$$$$$$$......$$$$$$$
........$$$o..$$$$$$$......$$$$......$$$$$$$
......."$$$"oo$$$$$$$......$$$"......$$$$$$$
............$$$$$$$$"......""........$$$$$$"
.............""""....................$$$$$"
.....................................$$$$"
.....................................$$"
....................o$$$o......ooo$$$oo
..................o$$$$$$$oo$$$$$$$$$$$o
................o$$$$$$$$$$$$$$$$$$$$$$$
..............o$$$$$$"""$$$$$$$$$$$""
...........o$$$$$"".......""$$$$$$"
..........o$""".............$$$$$$ooo
......................ooooo$$$$$$$$$$$o
.....................$$$$$$$$$$$$$$$$$$
.....................$$$$$$$$$$$$$$"""
......................"""""$$$$$$$
................o$$$o......$$$$$$$.ooooooooooo
................$$$$$$oooo$$$$$$$$$$$$$$$$$$$$$
............oooo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
.......oo$$$$$$$$$$$$$$$$$$$$$$$$$""""""""""""
.....o$$$$$$$$$$$$$$""""...$$$$$$$
.....$$$$$$$$"""...........$$$$$$$
......"""""................$$$$$$$
...........................$$$$$$$
...........................$$$$$$$
...........................$$$$$$
...........................$$$$$"
............................$$$
...............oo..........."""
..............$$$$$o..........oooo
..............$$$$$$..........$$$$$o
.............o$$$$$..........o$$$$$$
.............$$$$$$..........$$$$$$$oooooo
.............$$$$$$.......ooo$$$$$$$$$$$$$$$o
.......$$o...$$$$$$$$o...$$$$$$$$$$$$$$$$$$$$
......$$$$...$$$$$$$$$..."$$$$$$$$$$$"$$$$$$"
.....o$$$$oo$$$$$$$$$......"$$$$$$"...$$$$$$
.....$$$$$$$$$$$$$$"........$$$$$"..o$$$$$"
.....$$$$$$.$$$$$..........$$$$$$$$$$$$$$$$$$$$oo
....."$$$$$.$$$$$.oooo$$$$$$$$$$$$$$$$$$$$$$$$$$$$
......""""..$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
............$$$$$$$$$$$$$$$$$$$""""
............$$$$$.""""""$$$$$$"
............$$$$$......o$$$$$".....oo$$oo
............$$$$$.....o$$$$$"......$$$$$$$$o
............$$$$$....o$$$$$........"$$$$$$$$o
............$$$$$...o$$$$"...........$$$$$$$$
............$$$$$...$$$"..............$$$$$$$
.............$$$$...""................"$$$$$
............."$$"......................""""
.......................$$$$o
......................o$$$$$o.........oooo
..............o$$$....$$$$$$........o$$$$$o
.............$$$$$.$$$$$$$$$$$$$o.o$$$$$$"
............$$$$$"o$$$$$$$$$$$$$$$$$$$$"oo
...........$$$$...$$$$$$$$"$$$$$$$$$$"o$$$$o
........o$$$$$..oo$$$$$$$..$$$$$$$$$$o$$$$$
........$$$$$$$$$$$$$$$$$oo$$$$$$$$$$$$$"
........"$$$$$$$$$$$$$$$$$$$$$$$$.$$$$$$$o
............o$$$$$$$$$$$$""$$$$$$$$$$"$$$$$
...........o$$$$.o$$$$$$$oo$$$$$$$$$$$$$$$$
..........o$$$$$$$$$$$$$$$$$$$$$$$$$$"$$$$"
.........o$$$$$$$"""$$$$$$$$$$$$""...."""
.........."$$""....."$$"$$$$$$ooooooo$$$$$$$$o
...............ooooo$$$$$$$$$$$$$$$$$$$$$$$$$$o
.......ooo$$$$$$$$$$$$$$$$$$$$$$$$$$""""""""""
......o$$$$$$$$$$$$$$"""$$$$$$....o$$$$o
......."$$$$$"$$$$......$$$$$$...."$$$$$$o
.........""..$$$$$......$$$$$$.....$$$$$$$o
................$$$$$.....o$$$$$$......$$$$$$$
............."$$"...ooo$$$$$$$.......$$$$"
...................$$$$$$$$$"........"""
...................."""""
 
呵呵,我用了 whf 的方法,把你的源码调通了,现已发回给你,发分吧![:)]

另祝你 新春愉快!合家欢乐!
 
接受whf答案,同时感谢覆雨翻云、fpsky帮助
 
后退
顶部