Converting FP3 to FR3

edited 6:56AM in FastReport 4.0
Hi,

is it possible to convert a FP3 file to a FR3 file? I tried to save the PreviewPages of TfrxReport to a Stream and load that Stream in a TfrxPage but that does not seem like it works...

Is there a way to convert FP3 to FR3? (PreviewPages to a new Report?)

Thanks in advance,
Robert

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:56AM
    no a .fp3 file is a saved output file only.
  • edited May 2008
    Hi,

    I know what a fp3 file is, but that was not the question!

    My question was how to convert a fp3 file to a editable fr3 file. Our server generates fp3 files of all generated reports and saves them to an archive. Now I want to use this saved outputs in FastReport.

    My current code is (c++builder)

                    //there must be 2 TfrxReport Components:       fp   and    fr
    
        fp->PreviewPages->LoadFromFile("c:\\test.fp3");
        for (int p = 0; p < fp->PreviewPages->Count; ++p)
        {
            TfrxPage *srcPage = fp->PreviewPages->Page[p];
            TMemoryStream *str = new TMemoryStream();
            srcPage->SaveToStream(str);
            str->Position = 0;
            TfrxPage *pag = new TfrxPage(fr);
            pag->LoadFromStream(str);
            delete str;
        }
        fr->ShowReport();
    

    But that does not work - no new Pages or other TfrxViews are added to the report... (FastReport 4.5)
    Shouldn't there be at least one page in the new report? (Because I create a new Page with "new TfrxPage")

    Thanks in advance,
    Robert
  • edited 6:56AM
    Hi,

    It's me again [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I found a way to convert a FP3 file to FR3 manually: Open the Preview of the FP3-File and open the preview in Editor (Button "Edit Page" in Preview-Form). Now opens the FastReport Designer where I can save the page with "File" - "Save as". Is there a way to do that in my code without opening the Report Designer? Best regards, Robert[/img]

Leave a Comment