The use of TfrxOLEView

edited August 2017 in FastReport 4.0
Hello,

In using TfrxOLEView, I have the following error message
image.png

I use this method like this :
image.png

Why this error ?

Cordially
Pierrot

Comments

  • gpigpi
    edited 10:16PM
    Modify frxOLERTTI.pas
    uses
      Windows, Classes, Types, SysUtils, Forms, fs_iinterpreter, frxOLE, frxClassRTTI, Variants, OLECtnrs; //change
    ...
      TFunctions = class(TfsRTTIModule)
      private
        function CallMethod(Instance: TObject; ClassType: TClass;  //add
          const MethodName: String; Caller: TfsMethodHelper): Variant;  //add
        function GetProp(Instance: TObject; ClassType: TClass;
    ...
    
    constructor TFunctions.Create(AScript: TfsScript);
    begin
     ...
        AddEnum('TfrxSizeMode', 'fsmClip, fsmScale');
        with AddClass(TOLEContainer, 'TOLEContainer') do  //add
          AddMethod('procedure CreateObjectFromFile(const Filename: String; Iconic: Boolean)', CallMethod); //add
    ...
    //add begin
    
    function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
      const MethodName: String; Caller: TfsMethodHelper): Variant;
    begin
      Result := 0;
    
      if ClassType = TOLEContainer then
      begin
        if MethodName = 'CREATEOBJECTFROMFILE' then
          TOleContainer(Instance).CreateObjectFromFile(Caller.Params[0], Caller.Params[1]);
      end
    end;
    //add end
    
  • edited 10:16PM
    Hello,

    Thank you for your reply, but I have no file frxOLERTTI.pas files in the C: \ Program Files (x86) \ FastReports \ FastReport 4 \ LibD19 \

    Cordially
    Pierrot

  • gpigpi
    edited 10:16PM
    Sorry, but you can't to add this feature if you don't have a FR's sources. Try to move your code to Delphi's code
  • edited 10:16PM
    I have the standard version of FR, but the component is however present in FR.
    I do not understand how I can use this component.
    If I move the code to Delphi, it does not recognize this component either.
  • gpigpi
    edited 10:16PM
    Use TfrxReport.OnBeforePrint event
  • edited 10:16PM
    Thanks very much for your help.
    I could not watch this before 1 week.
    cordially

Leave a Comment