Search Results for

    Show / Hide Table of Contents

    Loading and saving a report

    By default, a report form is stored together with the project form, i.e. in a DFM file. In most cases, no more operations required, and you thus would not need to take special measures to load a report. If you decided to store a report form in a file or in the DB BLOb-field (this provides great flexibility, i.e. you can modify a report without recompiling the program), you would have to use the TfrxReport methods for report loading and saving:

    function LoadFromFile(const FileName: String; ExceptionIfNotFound: Boolean = False): Boolean;
    

    Loads a report from the file with the given name. If the second parameter is equal to “True” and the file is not found, then it generates an exception. If the file is loaded successfully, it returns “True.”

    procedure LoadFromStream(Stream: TStream);
    

    Loads a report from the stream.

    procedure SaveToFile(const FileName: String);
    

    Saves a report to a file with the specified name.

    procedure SaveToStream(Stream: TStream);
    

    Saves a report to a stream.

    File with a report form has the “FR3” extension by default.

    Examples:

    Pascal:

    frxReport1.LoadFromFile('c:\1.fr3');
    frxReport1.SaveToFile('c:\2.fr3');
    

    C++:

    frxReport1->LoadFromFile("c:\\1.fr3");
    frxReport1->SaveToFile("c:\\2.fr3");
    
    Back to top © Copyright Fast Reports Inc.