type 선언부를 잘보세요?
이방법은 델파이3.0의 DEMOS\QUICKRPT디렉토리에서 참조한 내용입니다..
interface uses 부분에 퀵레포트 폼의 Unit File을 지정하세요..
아마 잘될것입니다..
--------8<------------Cut-----8<---------------------8<-----------
unit xxx;
interface
uses
Windows, ....., Classes, Db, DBTables, StdCtrls, Mask,Dialogs,
.... DBGrids, ExtCtrls, Controls, ToolWin, quickrpt, QRF;
^^^^^^^^^^^^^^
// 퀵레포트 폼 Unit file지정
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
type
TFormGnTae = class(TForm)
.
.
.
private
FReport: TQuickRep;
procedure SetReport(Value: TQuickRep);
public
property Report: TQuickRep read FReport write SetReport;
end;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
var
Formxxx: TFormxxx;
implementation
uses Main ;
{$R *.DFM}
.
.
.
////////////////////////////////////////////////////////////////////////////////
// 인쇄
procedure TFormxxx.BitBtnPRTClick(Sender: TObject);
begin
{ 퀵레포트 폼에는 SQL 또는 StoredProc등의 쿼리 콤포런트가 있어야 합니다
그리고 그것은 여기서 실행 시키세요.
예를 들어 ,(여기서는 폼이름이 FormQR 입니다.)
FormQR.Close;
FormQR.SQL.Clear;
.
.
FormQR.Open;
}
Report:=FormQR.QuickRep;
Report.Print;
end;
////////////////////////////////////////////////////////////////////////////////
// 인쇄::프린터 셋
Procedure TFormxxx.SetReport(Value: TQuickRep);
begin
FReport:=Value;
end;
.
.
.
////////////////////////////////////////////////////////////////////////////////
// 종료지시
procedure TFormxxx.Button1Click(Sender: TObject);
begin
Close;
end;
////////////////////////////////////////////////////////////////////////////////
// 종료전
procedure TFormxxx.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if MessageDlg(Formxxx.Caption,mtConfirmation,[mbOk,mbNo],0) = mrNo
then CanClose := false;
end;
////////////////////////////////////////////////////////////////////////////////
// 종료
procedure TFormxxxe.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action :=caFree;
end;
end. { Final End }
|