网上找的一个工程老是提示
File not found: 'FR_Ctrls.dcu'我FastReport3,FastReport4  都反复安装好几次了 ,(FastReport用得是自动安装版fr4_2_d7e.exe)
都没有搜到'FR_Ctrls.dcu'FastReport  自带的demo  工程  都可以编译 运行 
为什么 会有个FR_Ctrls.dcu找不到?

解决方案 »

  1.   

    不太像是FastReport的东西。把工程.dpk备份一下,然后用记事本或UE打开dpk文件,找到FR_Ctrls相关的字样,删掉,保存,再编译。
      

  2.   

    是FastReport的东东,为FastReport2\Source路径下,你看看你的dcu路径。
    源文件内容为:{******************************************}
    {                                          }
    {             FastReport v2.53             }
    {              Tool controls               }
    {                                          }
    {Copyright(c) 1998-2004 by FastReports Inc.}
    {                                          }
    {******************************************}unit FR_Ctrls;interface{$I FR.inc}uses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls, ExtCtrls, Menus, Buttons;type
      TfrButtonState = (fbsUp, fbsDisabled, fbsDown, fbsExclusive, fbsInactive);  TfrSpeedButton = class(TGraphicControl)
      private
        FGroupIndex: Integer;
        FGlyph: Pointer;
        FDown: Boolean;
        FFlat: Boolean;
        FDragging: Boolean;
        FAllowAllUp: Boolean;
        FLayout: TButtonLayout;
        FSpacing: Integer;
        FMargin: Integer;
        FInactiveGrayed: Boolean;
        FOnMouseEnter: TNotifyEvent;
        FOnMouseLeave: TNotifyEvent;
        procedure GlyphChanged(Sender: TObject);
        function GetGlyph: TBitmap;
        procedure SetGlyph(Value: TBitmap);
        function GetNumGlyphs: TNumGlyphs;
        procedure SetNumGlyphs(Value: TNumGlyphs);
        procedure UpdateExclusive;
        procedure SetDown(Value: Boolean);
        procedure SetFlat(Value: Boolean);
        procedure SetAllowAllUp(Value: Boolean);
        procedure SetGroupIndex(Value: Integer);
        procedure SetLayout(Value: TButtonLayout);
        procedure SetInactiveGrayed(Value: Boolean);
        procedure UpdateTracking;
        procedure SetSpacing(Value: Integer);
        procedure SetMargin(Value: Integer);
        procedure WMLButtonDblClk(var Message: TWMLButtonDown); message WM_LBUTTONDBLCLK;
        procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
        procedure CMButtonPressed(var Message: TMessage); message CM_BUTTONPRESSED;
        procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
        procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
        procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
        procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE;
        procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
        procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
      protected
        FMouseInControl: Boolean;
        FState: TfrButtonState;
        function GetPalette: HPALETTE; override;
        procedure Loaded; override;
        procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
          X, Y: Integer); override;
        procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
        procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
          X, Y: Integer); override;
        procedure Paint; override;
      public
        constructor Create(AOwner: TComponent); override;
        destructor Destroy; override;
        procedure Click; override;
        procedure DrawGlyph(Canvas: TCanvas; X, Y: Integer; Enabled: Boolean);
      published
        property AllowAllUp: Boolean read FAllowAllUp write SetAllowAllUp default False;
        property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
        property Down: Boolean read FDown write SetDown default False;
        property Flat: Boolean read FFlat write SetFlat default False;
        property Caption;
        property Enabled;
        property Font;
        property Glyph: TBitmap read GetGlyph write SetGlyph;
        property GrayedInactive: Boolean read FInactiveGrayed write SetInactiveGrayed
          default True;
        property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
        property Margin: Integer read FMargin write SetMargin default -1;
        property NumGlyphs: TNumGlyphs read GetNumGlyphs write SetNumGlyphs default 1;
        property ParentFont;
        property ParentShowHint;
        property ShowHint;
        property Spacing: Integer read FSpacing write SetSpacing default 4;
        property Visible;
        property OnClick;
        property OnDblClick;
        property OnMouseDown;
        property OnMouseMove;
        property OnMouseUp;
        property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
        property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
      end;  TfrComboEdit = class(TComboBox)
      private
        FPanel: TWinControl;
        FButton: TfrSpeedButton;
        FButtonEnabled: Boolean;
        FOnButtonClick: TNotifyEvent;
        function GetGlyph: TBitmap;
        procedure SetGlyph(Value: TBitmap);
        function GetButtonHint: String;
        procedure SetButtonHint(Value: String);
        procedure SetButtonEnabled(Value: Boolean);
        procedure ButtonClick(Sender: TObject);
        procedure WMSize(var Message: TWMSize); message WM_SIZE;
        procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
        procedure SetPos;
      public
        constructor Create(AOwner: TComponent); override;
        procedure CreateWnd; override;
        procedure KeyPress(var Key: Char); override;
      published
        property Glyph: TBitmap read GetGlyph write SetGlyph;
        property ButtonEnabled: Boolean read FButtonEnabled write SetButtonEnabled default True;
        property ButtonHint: String read GetButtonHint write SetButtonHint;
        property OnButtonClick: TNotifyEvent read FOnButtonClick write FOnButtonClick;
      end;
    implementationuses CommCtrl, Printers {$IFDEF Delphi4}, ImgList {$ENDIF};type
      TGlyphList = class(TImageList)
      private
        Used: TBits;
        FCount: Integer;
        function AllocateIndex: Integer;
      public
        constructor CreateSize(AWidth, AHeight: Integer);
        destructor Destroy; override;
        function AddMasked(Image: TBitmap; MaskColor: TColor): Integer;
    {$IFDEF Delphi2}
        function Add(Image, Mask: TBitmap): Integer;
        procedure ReplaceMasked(Index: Integer; NewImage: TBitmap; MaskColor: TColor);
    {$ENDIF}
        procedure Delete(Index: Integer);
        property Count: Integer read FCount;
      end;  TGlyphCache = class
      private
        GlyphLists: TList;
      public
        constructor Create;
        destructor Destroy; override;
        function GetList(AWidth, AHeight: Integer): TGlyphList;
        procedure ReturnList(List: TGlyphList);
        function Empty: Boolean;
      end;  TButtonGlyph = class
      private
        FOriginal: TBitmap;
        FGlyphList: TGlyphList;
        FIndexs: array[TfrButtonState] of Integer;
        FTransparentColor: TColor;
        FNumGlyphs: TNumGlyphs;
        FOnChange: TNotifyEvent;
        procedure GlyphChanged(Sender: TObject);
        procedure SetGlyph(Value: TBitmap);
        procedure SetNumGlyphs(Value: TNumGlyphs);
        procedure Invalidate;
        function MapColor(Color: TColor): TColor;
        function CreateButtonGlyph(State: TfrButtonState): Integer;
        procedure DrawButtonGlyph(Canvas: TCanvas; X, Y: Integer;
          State: TfrButtonState; Transparent: Boolean);
        procedure DrawButtonText(Canvas: TCanvas; const Caption: string;
          TextBounds: TRect; State: TfrButtonState);
        procedure CalcButtonLayout(Canvas: TCanvas; const Client: TRect;
          const Caption: string; Layout: TButtonLayout; Margin, Spacing: Integer;
          var GlyphPos: TPoint; var TextBounds: TRect);
      public
        constructor Create;
        destructor Destroy; override;
        { return the text rectangle }
        function Draw(Canvas: TCanvas; const Client: TRect;
          const Caption: string; Layout: TButtonLayout; Margin, Spacing: Integer;
          State: TfrButtonState; Transparent: Boolean): TRect;
        property Glyph: TBitmap read FOriginal write SetGlyph;
        property NumGlyphs: TNumGlyphs read FNumGlyphs write SetNumGlyphs;
        property OnChange: TNotifyEvent read FOnChange write FOnChange;
      end;
    { TGlyphList }constructor TGlyphList.CreateSize(AWidth, AHeight: Integer);
    begin
      inherited CreateSize(AWidth, AHeight);
      Used := TBits.Create;
    end;destructor TGlyphList.Destroy;
    begin
      Used.Free;
      inherited Destroy;
    end;
      

  3.   

    function TGlyphList.AllocateIndex: Integer;
    begin
      Result := Used.OpenBit;
      if Result >= Used.Size then
      begin
        Result := inherited Add(nil, nil);
        Used.Size := Result + 1;
      end;
      Used[Result] := True;
    end;function TGlyphList.AddMasked(Image: TBitmap; MaskColor: TColor): Integer;
    begin
      Result := AllocateIndex;
      ReplaceMasked(Result, Image, MaskColor);
      Inc(FCount);
    end;{$IFDEF Delphi2}
    function TGlyphList.Add(Image, Mask: TBitmap): Integer;
    begin
      Result := AllocateIndex;
      Replace(Result, Image, Mask);
      Inc(FCount);
    end;procedure TGlyphList.ReplaceMasked(Index: Integer; NewImage: TBitmap; MaskColor: TColor);
    var
      TempIndex: Integer;
      Image, Mask: TBitmap;
    begin
      if HandleAllocated then begin
        TempIndex := inherited AddMasked(NewImage, MaskColor);
        if TempIndex <> -1 then
        try
          Image := TBitmap.Create;
          Mask := TBitmap.Create;
          try
            with Image do begin
              Height := Self.Height;
              Width := Self.Width;
            end;
            with Mask do begin
              Monochrome := True; { fix }
              Height := Self.Height;
              Width := Self.Width;
            end;
            ImageList_Draw(Handle, TempIndex, Image.Canvas.Handle, 0, 0, ILD_NORMAL);
            ImageList_Draw(Handle, TempIndex, Mask.Canvas.Handle, 0, 0, ILD_MASK);
            ImageList_Replace(Handle, Index, Image.Handle, Mask.Handle);
          finally
            Image.Free;
            Mask.Free;
          end;
        finally
          inherited Delete(TempIndex);
        end
      end;
      Change;
    end;
    {$ENDIF}procedure TGlyphList.Delete(Index: Integer);
    begin
      if Used[Index] then
      begin
        Dec(FCount);
        Used[Index] := False;
      end;
    end;{ TGlyphCache }constructor TGlyphCache.Create;
    begin
      inherited Create;
      GlyphLists := TList.Create;
    end;destructor TGlyphCache.Destroy;
    begin
      GlyphLists.Free;
      inherited Destroy;
    end;function TGlyphCache.GetList(AWidth, AHeight: Integer): TGlyphList;
    var
      I: Integer;
    begin
      for I := GlyphLists.Count - 1 downto 0 do
      begin
        Result := GlyphLists[I];
        with Result do
          if (AWidth = Width) and (AHeight = Height) then Exit;
      end;
      Result := TGlyphList.CreateSize(AWidth, AHeight);
      GlyphLists.Add(Result);
    end;procedure TGlyphCache.ReturnList(List: TGlyphList);
    begin
      if List = nil then Exit;
      if List.Count = 0 then
      begin
        GlyphLists.Remove(List);
        List.Free;
      end;
    end;function TGlyphCache.Empty: Boolean;
    begin
      Result := GlyphLists.Count = 0;
    end;
    var
      GlyphCache: TGlyphCache = nil;
      Pattern: TBitmap = nil;
      ButtonCount: Integer = 0;
      CacheBitmap: TBitmap = nil;
    procedure CreateBrushPattern;
    var
      X, Y: Integer;
    begin
      Pattern := TBitmap.Create;
      Pattern.Width := 8;
      Pattern.Height := 8;
      with Pattern.Canvas do
      begin
        Brush.Style := bsSolid;
        Brush.Color := clBtnFace;
        FillRect(Rect(0, 0, Pattern.Width, Pattern.Height));
        for Y := 0 to 7 do
          for X := 0 to 7 do
            if (Y mod 2) = (X mod 2) then  { toggles between even/odd pixles }
              Pixels[X, Y] := clWhite;     { on even/odd rows }
      end;
      CacheBitmap := TBitmap.Create;
      CacheBitmap.Width := 100; CacheBitmap.Height := 100;
    end;{ TButtonGlyph }constructor TButtonGlyph.Create;
    var
      I: TfrButtonState;
    begin
      inherited Create;
      FOriginal := TBitmap.Create;
      FOriginal.OnChange := GlyphChanged;
      FTransparentColor := clOlive;
      FNumGlyphs := 1;
      for I := Low(I) to High(I) do
        FIndexs[I] := -1;
      if GlyphCache = nil then GlyphCache := TGlyphCache.Create;
    end;destructor TButtonGlyph.Destroy;
    begin
      FOriginal.Free;
      Invalidate;
      if Assigned(GlyphCache) and GlyphCache.Empty then
      begin
        GlyphCache.Free;
        GlyphCache := nil;
      end;
      inherited Destroy;
    end;procedure TButtonGlyph.Invalidate;
    var
      I: TfrButtonState;
    begin
      for I := Low(I) to High(I) do
      begin
        if FIndexs[I] <> -1 then FGlyphList.Delete(FIndexs[I]);
        FIndexs[I] := -1;
      end;
      GlyphCache.ReturnList(FGlyphList);
      FGlyphList := nil;
    end;procedure TButtonGlyph.GlyphChanged(Sender: TObject);
    begin
      if Sender = FOriginal then
      begin
        FTransparentColor := FOriginal.TransparentColor;
        Invalidate;
        if Assigned(FOnChange) then FOnChange(Self);
      end;
    end;procedure TButtonGlyph.SetGlyph(Value: TBitmap);
    var
      Glyphs: Integer;
    begin
      Invalidate;
      FOriginal.Assign(Value);
      if (Value <> nil) and (Value.Height > 0) then
      begin
        FTransparentColor := Value.TransparentColor;
        if Value.Width mod Value.Height = 0 then
        begin
          Glyphs := Value.Width div Value.Height;
          if Glyphs > 4 then Glyphs := 1;
          SetNumGlyphs(Glyphs);
        end;
      end;
    end;procedure TButtonGlyph.SetNumGlyphs(Value: TNumGlyphs);
    begin
      if (Value <> FNumGlyphs) and (Value > 0) then
      begin
        Invalidate;
        FNumGlyphs := Value;
      end;
    end;function TButtonGlyph.MapColor(Color: TColor): TColor;
    var
      Index: Byte;
    begin
      if (Color = FTransparentColor) or (ColorToRGB(Color) =
        ColorToRGB(clBtnFace)) then Result := Color
      else begin
        Color := ColorToRGB(Color);
        Index := Byte(Longint(Word(GetRValue(Color)) * 77 +
          Word(GetGValue(Color)) * 150 + Word(GetBValue(Color)) * 29) shr 8);
        Result := RGB(Index, Index, Index);
      end;
    end;
      

  4.   

    这个是2.47版本的FastReport,高级版本中没有。
    你找的一个工程使用的Fastreport比较早。
      

  5.   

    FastReport  两个版本一起安装 怎么做呢?
      

  6.   

    2.X和3.X以上版本是可以混合安装的,如同安装两个不同的组件集。
    2.x安装比较简单,打开包,然后编译,然后install即可。设置好library目录
    按照官方的说法:FastReport3,FastReport4不可以共存。
    3.x以上版本安装参考:http://blog.csdn.net/SmallHand/archive/2009/02/18/3903862.aspx