Disable export to Word in FlexViewer

Posted by: carlos.taracena on 12 January 2019, 2:56 pm EST

    • Post Options:
    • Link

    Posted 12 January 2019, 2:56 pm EST

    Hi,

    I’m trying to migrate C1Report to FlexReport. In C1PrintPreviewControl there was an option to limit the types of exports that were allowed using the property ExportOptions. Is there any equivalent in FlexViewer?

    I need to disable the option to export to Word documents when the user clicks on the Export button on the FlexPreview control.

    Thank you.

  • Posted 14 January 2019, 4:52 am EST

    Hello,

    Though one cannot modify the default export button related options, adding a new export button with the required options is a way to go about it.

    You can first set the visibility of the existing Export button to false:

    c1FlexViewer1.RibbonElements.Export.Visible = false;
    
    

    and then add a RibbonButton to C1FlexViewer

    ```

            RibbonButton btn = new RibbonButton();
            btn.Text = c1FlexViewer1.RibbonElements.Export.Text;
            btn.LargeImage = c1FlexViewer1.RibbonElements.Export.LargeImage;
            btn.Click += Btn_Click;
            c1FlexViewer1.RibbonGroups.Tools.RibbonGroup.Items.Add(btn);  
    
    At the button click, a SaveFileDialog can be added and then the required filters can be added to it.
    

    private void Btn_Click(object sender, EventArgs e)

    {

    //add code here

    }

    https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/how-to-save-files-using-the-savefiledialog-component
    
    Let me know if you face any issues.
    Best Regards,
    Esha
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels