Export Method

PixelPointerPixelPointer Vaughan, Ontario
edited 12:56AM in FastReport 3.0
I am attempting to export to csv via Pascal Script. I am not sure if there is an export method for the TfrxReport object, or where I might find the syntax for it. I have run searches in this forum, and in the manuals, but to no avail. Can anyone help me out on this one?

Thank you,

Kevin ;) <-(sorry, had to put that guy on, he just looks cool LOL)

Comments

  • PixelPointerPixelPointer Vaughan, Ontario
    edited 12:56AM
    What! Does nobody export using the script in FR Designer? ;)
  • edited 12:56AM
    Can't you use the UserFunction Method?

    It work's like that:

    On Delphi:
    Procedure TFormMain.FormShow(Sender : TObject);
    Begin
        fsGlobalUnit.AddedBy := Self;
        fsGlobalUnit.AddMethod( 'function AnsiReplaceStr(const AText: String; const AFromText: String; const AToText: String): String', RelatorioUserFunction, 'ctString', '' );
        fsGlobalUnit.AddedBy := nil;
    End;
    
    Function TFormMain.RelatorioUserFunction(Instance: TObject; ClassType: TClass;
      Const MethodName: String; Var Params: Variant): Variant;
    Begin
        If MethodName = 'ANSIREPLACESTR' Then
            Result := AnsiReplaceStr( Params[0], Params[1], Params[2] );
    End;
    

    On the Script, you just call the function you declared.

    Btw, I think you should look for an alternative. Try to don't use FastScript.

    Regards.
  • PixelPointerPixelPointer Vaughan, Ontario
    edited February 2006
    It is my company that has chosen to use Fast Reports, not me. I was quite happy using Crystal. I actually don't have access to the Delphi code, as I am merely an end user of the tool. I only have access to whatever is in the designer, and getting a programming change takes months around here. I do appreciate your post, as I am getting very desperate right now. I am going to end up reporting that without programming changes, Fast Reports cannot do what is required, so we should just go back to using Crystal. Fast Reports seems to be ok for VERY simple reports, or if you are actually using it from within the Delphi environment, but from my perspective, it is horrible! ;)
  • gordkgordk St.Catherines On. Canada.
    edited 12:56AM
    in your situation it will depend upon what your programmer made available to you.
    when he created your report design app.
  • PixelPointerPixelPointer Vaughan, Ontario
    edited 12:56AM
    Well, I am still working through this. If I have the TfrxReport object available to me, is there a set of properties that I can set, and/or a method that I could use to export my report upon completion of the report?

    i.e.
    procedure FFReportOnStopReport(Sender: TfrxComponent);
    begin
         TfrxReport.PrintCSV(filename) <--yes, I made that up  
    end;
    
  • edited 12:56AM
    Actually, I like FastReport and don't think it's only ok for simple reports.

    What I really don't like is FastScript (like PascalScript). I had a lot of problems with it and have given up to use.

    You can Export on the AfterPrintReport event, if you have access to the source code.

    i.e.:
    procedure TFormMain.ReportAfterPrintReport(Sender: TObject);
    begin
        Report.Export( AnyExportFilter );
    end;
    

    regards.
  • PixelPointerPixelPointer Vaughan, Ontario
    edited February 2006
    I have spoken with our programmers, and they are adding an export function for me, so that I no longer need to try to mess with scripts to export. Thank you.

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.