ReportViewer

3 posts, 0 answers
  1. Marc-Andre
    Marc-Andre avatar
    2 posts
    Member since:
    Oct 2015

    Posted 06 Jul Link to this post

    Hi,

    Is it possible for the ReportViewer to use your RadSaveDialog during exportation.

     

    Thanks

    Marc

  2. Ivan Hristov
    Admin
    Ivan Hristov avatar
    172 posts

    Posted 09 Jul Link to this post

    Hi Marc,

    Yes, you can handle the ReportViewer's ExportEnd event and override the default behavior as shown below:

    public Window1()
    {
        InitializeComponent();
     
        this.ReportViewer1.ExportEnd += ReportViewer1_ExportEnd;
    }
     
    private void ReportViewer1_ExportEnd(object sender, Telerik.ReportViewer.Common.ExportEndEventArgs args)
    {
        args.Handled = true;
     
        var fileDialog = new RadSaveFileDialog()
        {
            Owner = this,
            FileName = args.DocumentName,
            DefaultExt = args.DocumentExtension
        };
     
        if (fileDialog.ShowDialog() == true)
        {
            using (var stream = fileDialog.OpenFile())
            {
                stream.Write(args.DocumentBytes, 0, args.DocumentBytes.Length);
            }
        }
    }


    Regards,
    Ivan Hristov
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Marc-Andre
    Marc-Andre avatar
    2 posts
    Member since:
    Oct 2015

    Posted 14 Jul in reply to Ivan Hristov Link to this post

    Hi Ivan,

    Work perfectly !!

    Thanks
    Marc

Back to Top