서기원님 문서를 직접 메일로 보내주셔서 감사합니다. ^^
1. import type library시에요... 크리스탈 리프트회사에서 나온 문서랑 보내주신 문서랑 import하는게 차이가 나네요... ^^;;
크리스탈에서 나온 문서
: Crystal Reports 9 ActiveX Designer Design and Runtime Library
보내주신 문서
:
: Crystal Reports 9 ActiveX Designer Run time Library
2. 소스 에러가 나서요..
사용컴포넌트: (CRViewer9) , Application
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, CRVIEWER9Lib_TLB, OleServer, CRAXDRT_TLB;
type
TForm1 = class(TForm)
CRViewer91: TCRViewer9;
Application1: TApplication; //<----------- 이거 에러가..
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ViewerReSize();
begin
CRViewer91.Width := Form1.Width - 10;
CRViewer91.Height := Form1.Height - 30;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ViewerReSize();
ViewReport();
end;
procedure TForm1.FormResize(Sender: TObject);
begin
ViewerReSize();
end;
procedure TForm1.ViewReport();
var
CrReport : IReport;
FileName : String;
begin
FileName := ExtractFilePath(Forms.Application.ExeName);
FileName := FileName + 'sample1.rpt';
CrReport := Application1.OpenReport(FileName,crOpenReportByTempCopy);
CrReport.EnableParameterPrompting := false;
CrReport.DiscardSavedData;
CRViewer91.ReportSource := CrReport;
CRViewer91.ViewReport;
CrReport := nil;
Application1.Destroy;
end;
end.
2.Application1: TApplication; 위치를 조정하면 될 것 같습니다. 소스대로 해보니 Application1을 없애라고 하는데요? 저는 TCrystalActiveXReportViewer를 폼에 올려놓고 사용합니다.
TForm1 = class(TForm)
CRViewer : TCrystalActiveXReportViewer;
private
{ Private declarations }
CrReport : IReport
Application1: TApplication; //<------- 저는 이렇게 사용하고 있습니다.
public
{ Public declarations }
end;
그럼 즐푸하세요