WinUI | ComponentOne
Controls / FlexViewer / Export
In This Topic
    Export
    In This Topic

    FlexViewer lets you export reports as digital files for sharing with coworkers or clients, eliminating the need to print. Users can choose formats like PDF, HTML, RTF, Excel Open XML, Word Open XML, ZIP, TIFF, BMP, PNG, JPEG, and GIF. After selecting the format and clicking the Export button, the Save As dialog box opens that allows you to export a report to different formats.

     

    Export FlexReport Programmatically

    Besides exporting FlexReport to different file formats at runtime, you can also export them programmatically. For exporting reports into different file formats, you need the respective classes available in the C1.Document API. The following example for exporting a report uses a sample created in View Documents.

    Render FlexReport using HTMLFilter class

    FlexReport allows you to export a report to HTML format using the HtmlFilter class, which renders the report into HTML streams or files as showcased in the following code.

    C#
    Copy Code
    private void myButton_Click(object sender, RoutedEventArgs e)
    {
      HtmlFilter f = new HtmlFilter();
      f.FileName = @"D:\Reports\ProductReport.html";
      flexReport.RenderToFilter(f);     
    }
    

    Similarly, the reports or PDF documents can be export in different formats using their respective classes and the RenderToFilter method, which renders the report or PDF into the ExportFilter object.