QuickRep 出現printng progress問題 |
答題得分者是:P.D.
|
letkiss2002
一般會員 發表:4 回覆:9 積分:2 註冊:2009-10-02 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
光憑這樣的訊息, 神仙也難救啊!
這關係到你的QR版面設計, 資料庫連結, 資料開啟等等問題 ===================引 用 letkiss2002 文 章=================== 你好: 我想請問眾位高手 我要印列 QuickRep中的內容 我可以預覽 QuickRep 資料,但再列印有出現"printng progress"但卻印不出任何資料 (就算我轉PDF 也無法轉出任何資料) 不知是那兒出錯了,高手們可以幫我解答嗎? 丫里丫多~~~^^ |
letkiss2002
一般會員 發表:4 回覆:9 積分:2 註冊:2009-10-02 發送簡訊給我 |
以下是我的 Quick Report程式碼
我可以預覽到每一頁的資料 但不管是轉成pdf或列印出來 都會是空白的一頁 不知那兒出錯了 [code delphi] unit MDE800401; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, QRCtrls, QuickRpt, ExtCtrls; type TRMDE800401 = class(TForm) QuickRep1: TQuickRep; DetailBand1: TQRBand; QRShape9: TQRShape; QRShape8: TQRShape; QRShape7: TQRShape; QRShape6: TQRShape; QRShape5: TQRShape; QRShape49: TQRShape; QRShape48: TQRShape; QRShape47: TQRShape; QRShape46: TQRShape; QRShape45: TQRShape; QRShape44: TQRShape; QRShape43: TQRShape; QRShape42: TQRShape; QRShape41: TQRShape; QRShape40: TQRShape; QRShape4: TQRShape; QRShape39: TQRShape; QRShape38: TQRShape; QRShape37: TQRShape; QRShape36: TQRShape; QRShape35: TQRShape; QRShape34: TQRShape; QRShape33: TQRShape; QRShape32: TQRShape; QRShape31: TQRShape; QRShape30: TQRShape; QRShape3: TQRShape; QRShape29: TQRShape; QRShape28: TQRShape; QRShape27: TQRShape; QRShape26: TQRShape; QRShape25: TQRShape; QRShape24: TQRShape; QRShape23: TQRShape; QRShape22: TQRShape; QRShape21: TQRShape; QRShape20: TQRShape; QRShape2: TQRShape; QRShape19: TQRShape; QRShape18: TQRShape; QRShape17: TQRShape; QRShape16: TQRShape; QRShape15: TQRShape; QRShape14: TQRShape; QRShape13: TQRShape; QRShape12: TQRShape; QRShape11: TQRShape; QRShape10: TQRShape; QRShape1: TQRShape; QRDBText4: TQRDBText; QRDBText3: TQRDBText; QRDBText2: TQRDBText; QRDBText1: TQRDBText; y9: TQRShape; y8: TQRShape; y7: TQRShape; y6: TQRShape; y5: TQRShape; y4: TQRShape; y3: TQRShape; y2: TQRShape; y1: TQRShape; s2_9: TQRShape; s2_8: TQRShape; s2_7: TQRShape; s2_6: TQRShape; s2_5: TQRShape; s2_4: TQRShape; s2_3: TQRShape; s2_2: TQRShape; s2_1: TQRShape; s2_0: TQRShape; s1_9: TQRShape; s1_8: TQRShape; s1_7: TQRShape; s1_6: TQRShape; s1_5: TQRShape; s1_4: TQRShape; s1_3: TQRShape; s1_2: TQRShape; s1_1: TQRShape; s1_0: TQRShape; QRLabel6: TQRLabel; QRLabel5: TQRLabel; QRLabel4: TQRLabel; QRLabel3: TQRLabel; QRLabel2: TQRLabel; QRLabel1: TQRLabel; c2_9: TQRShape; c2_8: TQRShape; c2_7: TQRShape; c2_6: TQRShape; c2_5: TQRShape; c2_4: TQRShape; c2_3: TQRShape; c2_2: TQRShape; c2_1: TQRShape; c2_0: TQRShape; c1_9: TQRShape; c1_8: TQRShape; c1_7: TQRShape; c1_6: TQRShape; c1_5: TQRShape; c1_4: TQRShape; c1_3: TQRShape; c1_2: TQRShape; c1_1: TQRShape; c1_0: TQRShape; procedure DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean); procedure QuickRep1NeedData(Sender: TObject; var MoreData: Boolean); procedure DetailBand1AfterPrint(Sender: TQRCustomBand; BandPrinted: Boolean); private { Private declarations } public { Public declarations } end; var RMDE800401: TRMDE800401; implementation {$R *.dfm} uses Mainform; var i:integer; procedure TRMDE800401.DetailBand1BeforePrint(Sender: TQRCustomBand; var PrintBand: Boolean); var yQRshape: TQRShape; c1QRshape: TQRShape; c2QRshape: TQRShape; begin QRLabel1.Caption := MainForm1.StringGrid1.Cells[1, i]; QRLabel2.Caption := MainForm1.StringGrid1.Cells[2, i]; QRLabel3.Caption := MainForm1.StringGrid1.Cells[3, i]; QRLabel4.Caption := MainForm1.StringGrid1.Cells[4, i]; // QRLabel5.Caption := MainForm.MainForm1.StringGrid1.Cells[5, i]; //QRLabel6.Caption := MainForm.MainForm1.StringGrid1.Cells[6, i]; yQRshape:= TQRShape(FindComponent('y' Copy(MainForm.MainForm1.StringGrid1.Cells[1, i],1,1))); c1QRshape:= TQRShape(FindComponent('c1_' Copy(MainForm.MainForm1.StringGrid1.Cells[2, i],1,1))); c2QRshape:= TQRShape(FindComponent('c2_' Copy(MainForm.MainForm1.StringGrid1.Cells[2, i],2,1))); inc(i); if (yQRshape<>nil) and (c1QRshape<>nil) and (c2QRshape<>nil) then begin yQRshape.Enabled:= True; c1QRshape.Enabled:= True; c2QRshape.Enabled:= True; end; end; procedure TRMDE800401.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean); begin if i <= MainForm1.StringGrid1.RowCount - 1 then moredata := true else moredata := false ; QuickRep1.NewPage; end; procedure TRMDE800401.DetailBand1AfterPrint(Sender: TQRCustomBand; BandPrinted: Boolean); begin y1.Enabled:=False; y2.Enabled:=False; y3.Enabled:=False; y4.Enabled:=False; y5.Enabled:=False; y6.Enabled:=False; y7.Enabled:=False; y8.Enabled:=False; y9.Enabled:=False; c1_1.Enabled:=False; c1_2.Enabled:=False; c1_3.Enabled:=False; c1_4.Enabled:=False; c1_5.Enabled:=False; c1_6.Enabled:=False; c1_7.Enabled:=False; c1_8.Enabled:=False; c1_9.Enabled:=False; c1_0.Enabled:=False; c2_1.Enabled:=False; c2_2.Enabled:=False; c2_3.Enabled:=False; c2_4.Enabled:=False; c2_5.Enabled:=False; c2_6.Enabled:=False; c2_7.Enabled:=False; c2_8.Enabled:=False; c2_9.Enabled:=False; c2_0.Enabled:=False; end; end.[/code]
------
sky |
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
說真的,我還是看不懂你上來的程式, 因為 在QR版面的設置我看不到,
以及我也不知道你印出來的是什麼東東 你要不要先確認 TFindComponent 的物件確實存不存在, 因為你下了一個很嚴苛的條件, 必須三個TFindComponent <> nil 才可以啟動, 先拿掉這段<> nil 的判斷, 直接為 enabled:= true 可印嗎? 還有你秀出來的是Detail的部份, 那與master連結的部份是如何的呢? Master-Detail, 如果 Master 沒有資料, Detail也會出不來!
編輯記錄
P.D. 重新編輯於 2012-02-07 11:43:54, 註解 無‧
|
letkiss2002
一般會員 發表:4 回覆:9 積分:2 註冊:2009-10-02 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
letkiss2002
一般會員 發表:4 回覆:9 積分:2 註冊:2009-10-02 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |