bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Delphi FastReport 報表元件 FastReport 明細表格補滿空白
查看: 9075|回復: 3
go

FastReport 明細表格補滿空白 [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2006-7-7 11:22 |只看該作者 |倒序瀏覽 |打印
  1. procedure Footer1OnBeforePrint(Sender: TfrxComponent);
  2. begin
  3.   while Engine.freespace >20 do
  4.   begin
  5.     Engine.showband(child1)
  6.   end;
  7. end;
複製代碼

将 footer 的 height = 0
ok
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw

Rank: 9Rank: 9Rank: 9

2#
發表於 2006-7-7 12:10 |只看該作者
上列方法在網路上看到有人說在 FR3 中不可使用
是因為到了  PageFooter 時 FreeSpace 就變成 0 了.
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw

Rank: 9Rank: 9Rank: 9

3#
發表於 2006-7-7 12:16 |只看該作者
若是用程式判斷固定資料行數,若是在會 Stretched 的狀況下有可能會因為列印補滿固定資料行數而超出一頁。
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw

Rank: 9Rank: 9Rank: 9

4#
發表於 2007-9-3 11:18 |只看該作者
困擾多時的問題終於解決了

進入報表設計工具,在報表中加入一個 footerband 然後因為這個 footer 不需要顯示所以將 height 設為 0

接著使用下列程式碼:
  1. procedure Footer1OnBeforePrint(Sender: TfrxComponent);
  2. var i:integer;                                 
  3. begin
  4.   if int(Engine.FreeSpace/Child1.Height) > 0 then
  5.   begin
  6.     for i := 1 to int(Engine.FreeSpace/Child1.Height) do
  7.     begin
  8.       Engine.ShowBand(Child1);
  9.     end;              
  10.   end;            
  11. end;
複製代碼


此方法是我在 FastReport 4.2 下解決
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-4-25 14:10 , Processed in 0.009274 second(s), 11 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.