您的位置:首页 > 其它

Crystal report viewer 控件TCrystalActiveXReportViewer的使用

2007-09-03 11:48 459 查看
procedure TGL_CC_ReportCollection.OpenReport( const ReportFileName: string;
fromMenuPrinc : Boolean);
var
FormCrystal : TForm;

begin
try
Screen.Cursor := crHourGlass;

try

FormCrystal := TFormCrystal.Create(Forms.Application);
FormCrystal.Name := 'TFormCrystal';

Try
CrystalActiveXReportViewer :=
TCrystalActiveXReportViewer.Create(FormCrystal);

oApp :=CreateOleObject('CrystalRuntime.Application');
oRpt:=oApp.openreport(ReportFileName,1);
CrystalActiveXReportViewer.ReportSource := oRpt;

InitializeReport(CrystalActiveXReportViewer, FormCrystal);
ShowReport(CrystalActiveXReportViewer, FormCrystal);
End; (* Try *)

except
on E:Exception do
begin
raise;
end; // on..end
end; // try..except
finally
Screen.Cursor := crDefault;
end; // try..finally
end; // OpenReport..end
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: