請教delphi 7 + crystavl report 8.5 ocx 中如何調用subreport |
|
dongpo
一般會員 ![]() ![]() 發表:1 回覆:8 積分:6 註冊:2006-11-01 發送簡訊給我 |
|
dongpo
一般會員 ![]() ![]() 發表:1 回覆:8 積分:6 註冊:2006-11-01 發送簡訊給我 |
//现将调用不含子报表的发表一下
请高手指点如果g_report中含有一个子报表,怎样将记录集传给子报表? unit Unreport1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, OleServer, CRAXDRT_TLB, OleCtrls, CRVIEWERLib_TLB; type Tfrmreport = class(TForm) CRViewer1: TCRViewer; Application1: TApplication; procedure FormResize(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } public { Public declarations } Report :IReport; end; var frmreport: Tfrmreport; implementation uses undm,ubasefun; {$R *.dfm} procedure Tfrmreport.FormResize(Sender: TObject); begin crViewer1.Top := 0; crViewer1.Left := 0; crviewer1.Height := self.Height - 40; // -150 to leave space for the buttons crviewer1.Width := self.width-26; end; procedure Tfrmreport.FormShow(Sender: TObject); begin Report := Application1.OpenReport(ExtractFilePath(Forms.Application.ExeName) g_report,crOpenReportByTempCopy); Report.DiscardSavedData; Report.Database.SetDataSource(dm.rstreport.Recordset, 3, 1); crViewer1.ReportSource := Report; crViewer1.ViewReport; end; procedure Tfrmreport.FormClose(Sender: TObject; var Action: TCloseAction); begin Report := nil; Application1 := nil; Action := caFree; frmreport:=nil; end; end. |
dongpo
一般會員 ![]() ![]() 發表:1 回覆:8 積分:6 註冊:2006-11-01 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |