TTS
初階會員

 發表:72 回覆:66 積分:27 註冊:2003-05-06
發送簡訊給我
|
如果QuickRep裡有使用TQGroup 且forcepage設為True時
這時該如何預先抓出報表的總頁數
小弟是想做出 1/3, 2/3, 3/3的顯示效果 所以須先抓出總頁數 -Tks- 發表人 - TTS 於 2005/07/27 00:08:32
|
supman
尊榮會員
    
 發表:29 回覆:770 積分:924 註冊:2002-04-22
發送簡訊給我
|
使用Prepare,請參考我以下這篇
http://delphi.ktop.com.tw/topic.php?TOPIC_ID=73838
|
TTS
初階會員

 發表:72 回覆:66 積分:27 註冊:2003-05-06
發送簡訊給我
|
supman大大
小弟目前的跳頁控制(QuickRep1.NewPage)是寫在DetailBand.BeforePrint裡
已試過您提供的方式 但是還是1/0, 2/0. 3/0...
我在QuickRep1.BeforePrint, QuickRep1.OnPreview都寫過 但是不行
我的寫法是
begin
QuickRep1.Prepare;
TotPages:= QuickRep1.PageNumer;
end; 請問會是哪裡的問題呢???
|
supman
尊榮會員
    
 發表:29 回覆:770 積分:924 註冊:2002-04-22
發送簡訊給我
|
要先在preview之前先做一次prepare的動作。
然後你的報表上
跳頁控制/QuickRep1.PageNumer
紅色的部分放一個QRLabel寫死,在呼叫Preview之前就先先將總頁數等於過去
QuickRep.Prepare;
QRLabel.Caption:=IntToStr(QuickRep1.PageNumer);
QuickRep.Preview;
|
TTS
初階會員

 發表:72 回覆:66 積分:27 註冊:2003-05-06
發送簡訊給我
|
Supman大大
小弟有在preview之前先做一次prepare的動作
QuickRep.Prepare;
QRLabel.Caption:=IntToStr(QuickRep1.PageNumer);
QuickRep.Preview;
但是報表出來後第一張會先多印一張Detail沒資料的報表耶!?
|
supman
尊榮會員
    
 發表:29 回覆:770 積分:924 註冊:2002-04-22
發送簡訊給我
|
Prepare的動作就是去跑一次報表,當你再Preview時等於跑第二次,你會出現一個Datail沒有資料,可能是你有變數沒去初始化所造成,你連續Preview兩次看看是否也有同樣問題,先檢查你的報表程式看看,因為只憑這樣講很難猜出問題,另外,你要測試總頁數,可以先開一張空白報表測試,確定可行了以後再加到你的程式,避免其他變因的影響.
|