Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6660971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:13:17+00:00 2026-05-26T02:13:17+00:00

When using the default export buttons within the ReportViewer, is there a way to

  • 0

When using the default export buttons within the ReportViewer, is there a way to simply prompt the user to open the exported report? I looked at the ReportExport event, though this fires before the export occurs. The only thing I can think of is to cancel the ReportExport and create my own export functionality, though I hope I do not need to do this. Are there any events that I’m missing that fire after the export occurs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:13:18+00:00Added an answer on May 26, 2026 at 2:13 am

    I found a solution for this. @KreepN, I had seen similar solutions to yours online throughout various discussion boards, however, I’ve found another solution which better suites what I was looking for. This provides all of the default functionality for exporting. Here’s what I did:

    First, subscribe to the ReportExport event when form is created.

    this.reportViewer1.ReportExport += new ExportEventHandler(this.ReportViewer1_ReportExport);
    

    Here’s my ReportExport event handling method:

    private void ReportViewer1_ReportExport(object sender, ReportExportEventArgs e)
    {
        e.Cancel = true;
    
        string extension = this.GetRenderingExtension(e.Extension);
    
        SaveFileDialog saveFileDialog = new SaveFileDialog()
        {
            Title = "Save As",
            CheckPathExists = true,
            InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
            Filter = e.Extension.LocalizedName + " (*" + extension + ")|*" + extension + "|All files(*.*)|*.*",
            FilterIndex = 0
        };
    
        if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
        {
            this.reportViewer1.ExportDialog(e.Extension, e.DeviceInfo, saveFileDialog.FileName);
    
            // Here's where I call my method to prompt user to open the file.
            RadExportHelper.OpenFileWithPrompt(saveFileDialog.FileName);                
        }
    }
    

    The RenderingExtension class doesn’t publicly expose the actual file extensions that are exported, so I created this method:

    private string GetRenderingExtension(RenderingExtension extension)
    {
        switch (extension.Name)
        {
            case "PDF":
                return ".pdf";
            case "CSV":
                return ".csv";
            case "EXCEL":
                return ".xls";
            case "MHTML":
                return ".mhtml";
            case "IMAGE":
                return ".tif";
            case "XML":
                return ".xml";
            case "WORD":
                return ".doc";
            case "HTML4.0":
                return ".html";
            case "NULL":
                throw new NotImplementedException("Extension not implemented.");
        }
    
        throw new NotImplementedException("Extension not implemented.");
    }
    

    Lastly, here’s my helper method to prompt the user and open the file if they choose:

    public static void OpenFileWithPrompt(string file)
    {
        if (RadMessageBox.Show(
            Resources.RadHelper_OpenExportedDataMessage,
            Resources.RadHelper_OpenExportedDataTitle,
            MessageBoxButtons.YesNo,
            RadMessageIcon.Question,
            MessageBoxDefaultButton.Button1) == DialogResult.Yes)
        {
            Process.Start(file);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any implications to using default values, such as empty strings, when inserting
I am using EJB3 on Glassfish using the default TopLink persistance manager. Within a
I have Finished Designing my first Crystal Report using ASP.NET, I am Providing user
Is there a default location to store the PHPUNIT extension? I'm using symfony2 and
I'm using the default settings in Eclipse to export my application and have Proguard
Im using default profile for magento product export when i click the run profile
I'm currently using default implementation of STL for VS2005 and I'm not really satisfied
I´m trying to separate a gridViewColumn into two rows. Im using default style for
Using the default TWebBrowser makes things easy to embed a web browser. Unfortunately the
By default (using the plain style) BibTeX orders citations alphabetically. How to order the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.