在FastReport 中我用frreport1.showreport;但為何什麼都不出現呀? |
答題得分者是:P.D.
|
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
引言: 在FastReport 中我用frreport1.showreport;但為何什麼都不出現呀? 小弟剛用FASTREPORT,好多不知。 胡 給你一支我常用的方法, 有preview, print 方式, 當然拿這支程式要直接套用是不可能, 提供你有關如何使用fr的重點, 另外, fr_demo(到 fastreport網抓)有十分詳細的寫法, 你必須 uses FR_Class procedure TForm_PrintCondition.PrintPrepare(actiontype: string); var frmFile: string; Report: TfrReport; begin frmFile:= '\FRFORM\REP2011.FRF' Form_frPreview:= TForm_frPreview.Create(Application); Report:= Form_PrintCondition.frReport1; Form_frPreview.frReport1:= Report; if not Report.LoadFromFile(frmFile) then begin Application.MessageBox(pChar('找不到 ' frmFile ' 報表定義檔!'),'錯誤',MB_OK); Form_frPreview.Free; Report.Free; exit; end; SysUt.MsgDialog('報表產生中....請稍候'); // 預覽列印 if actiontype='Preview' then begin try Report.Preview:= Form_frPreview.frPreview1; Form_frPreview.Caption:= Form_FixPrint.Caption '預覽模式'; if Report.PrepareReport then begin Report.ShowPreparedReport; Form_frPreview.ShowModal; end; finally Form_frPreview.Free; end; end // 直接列印 else begin Report.Preview:= nil; try if Report.PrepareReport then Report.PrintPreparedReportDlg; finally Form_frPreview.Free; end; end; if Form_Wait <> nil then Form_Wait.Free; end; 以上你必須建立兩個form, 一個做為條件設定畫面之用, 把 frDBdataset放在這(Form_FixPrint), 另一個是preview之用(form_frpreview), 放一個frpreview object及其他物件(如frbarcode, frrichtext..., 視自己情況而定)另外, http://pgsql.vip.idv.tw:8080/ 這裡有更多fr高手在等待你的呼叫! 發表人 - P.D. 於 2003/01/07 00:12:38 |
banson1716
高階會員 發表:55 回覆:182 積分:167 註冊:2002-04-14 發送簡訊給我 |
試試看下列的程式有什麼動作??
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
frReport1.LoadFromFile('Test.frf');//要建'Test.frf'檔或自己建立.frf
frReport1.ShowReport;
end; procedure TForm1.BitBtn2Click(Sender: TObject);
begin
frReport1.LoadFromFile('Test.frf');//要建'Test.frf'檔或自己建立.frf
frReport1.DesignReport;
end;
|
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
引言: 在FASTREPORT中的MEMO範例中沒有用LOADFROMFILE它也可以出現那個預覽的窗口呀! 它的打印按鈕下的代碼就個Frreport1.SHOWREPORT,就實現了打印,是不是有其它的什麼地方設置呀? 胡不知道你看的demo檔是那一支, 我查過frdemo 有 loadfromfile, 以下擷取部份碼 with Form2.frReport1 do begin LoadFromFile(WPath IntToStr(n) '.frf'); if Dictionary.Variables.IndexOf('Description') <> - 1 then Memo1.Text := Dictionary.Variables['Description'] else Memo1.Text := ''; DesignBtn.Enabled := True; PreviewBtn.Enabled := True; end; fr 是透過 frf 來載入執行, 所以會有loadformfile行為 |
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
hua2000
中階會員 發表:102 回覆:200 積分:65 註冊:2006-11-04 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |