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 1:17PM
    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 1:17PM
    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 1:17PM
    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 1:17PM
    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 1:17PM
    Use TfrxReport.OnBeforePrint event
  • edited 1:17PM
    Thanks very much for your help.
    I could not watch this before 1 week.
    cordially

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.