Delphi中怎样安装Crystal 9 (或8.5)?

解决方案 »

  1.   

    转载以前的贴子。你只需要把控件install到activex中即可。
    步骤如下:
    在安装crystal report(设计环境)时,即安装了各种控件。
        下面是在delphi中安装控件的步骤:
    (1) project -- import type library  出现一个ListBox;
    (2) 在ListBox中,选择crystal report 9 activx designer design and runtime library;
    (3) 点击install按钮,然后点击into new package(如:d:\borland\delphi7\Lib\cradrl.dpk),点ok即可。在确定框中点yes,在ActiveX中增加了一个application控件。(如果有类重名,改名即可)
    (4) 重复以上三步可以添加Crystal Reports Viewer Control(Version 9.2)(用于显示报表),和Embeddable Crystal Reports 9 Designer Control(Version 9.2)(用于设计报表)等等。
    (5) 在安装Embeddable Crystal Reports 9 Designer Control(Version 9.2)等控件时,出现“库没有注册”错误,可以在命令行中输入:
    C:\PROGRA~1\CRYSTA~1\Report Designer Component>Regsvr32.exe  CRDesignerCtrl.dll
    来注册一个控件。下面是显示报表内容的步骤:
    在form上放一个report, 一个application, 一个CRViewer控件,一个button。button的代码:
    procedure TForm2.Button2Click(Sender: TObject);
    var
       report : IReport;
    begin
    report := Application1.OpenReport('e:\zd\cdma\data\test.rpt',crOpenReportByTempCopy);
    crViewer91.ReportSource := report;
    crViewer91.ViewReport;end;
      

  2.   

    X:\Program Files\Crystal Decisions\Crystal Reports 9\Samples\chs\Code\Delphi\cr85vcl.exeX为你的报表安装目录/
      

  3.   

    运行..\Program Files\Crystal Decisions\Crystal Reports 9\Samples\chs\Code\Delphi\cr85vcl.exe即可加入到delphi6的DataAccess面板中(crpe控件)