Get pdf from WebReport-object or from Report-object

OlaOla
edited 11:23PM in FastReport .NET
In my project I generate a Fastreport.Web.Webreport with a FastReport.Report that is shown to the user. I'm wondering if there is a way to get hold of the report on pdf-form from the Report-object or WebReport-object. (On code level that is, not by manually saving it from a preview window or anything.)

Comments

  • edited 11:23PM
    Use the PDFExport class.

    e.g;
    Report report = new Report();
    PDFExport reportexport = new PDFExport();
    report.Load("...reportpath/report.frx");
    
    // Prepare and export pdf
    byte[] pdf;
    report.Prepare();
    using (MemoryStream stream = new MemoryStream()) {
        report.Export(reportexport, stream);
        stream.Position = 0;
        pdf = stream.ToArray();
    }
    

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.