Show ProgressBar when exporting RDLC Report to PDF in ASP.Net

Last Reply on Sep 02, 2015 09:12 AM By Mudassar

Posted on Sep 02, 2015 09:01 AM

Here's my chunk of code :

    public void ExportToPDF(string path, List<ReportParameter> reportParams, string fileName)
    {
        Warning[] warnings;
        string[] streamIds;
        string mimeType = string.Empty;
        string encoding = string.Empty;
        string extension = string.Empty;

        // Setup the report viewer object and get the array of bytes
        var viewer = new ReportViewer();
        viewer.ProcessingMode = ProcessingMode.Remote;
        viewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");
        viewer.ServerReport.ReportPath = "/" + path;
        viewer.ServerReport.SetParameters(reportParams);
        
        byte[] bytes = viewer.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension,
            out streamIds, out warnings);

        // Now that you have all the bytes representing the PDF report, buffer it and send it to the client.
        Response.Buffer = true;
        Response.Clear(); 
        Response.ContentType = mimeType;
        Response.AddHeader("content-disposition",
            "attachment; filename=" + fileName + "(" + DateTime.Now.ToShortDateString() + ")" + ".pdf");
        Response.BinaryWrite(bytes); // create the file
        Response.Flush(); // send it to the client to download

    }

I have no update panel on this page , simply when i click on Export BTN i want to show the progress bar , this should be real not fake. I followed this article :

http://www.aspsnippets.com/Articles/Show-progress-bar-on-Button-Click-in-ASPNet.aspx

But that's fake , not real. 

NOTE :

I have hide report viewer , just exporting the report via provided code.

NEED :

I want to show real progress bar until report is being rendered as PDF and when it is done that progress bar should get disappeared.

Posted on Sep 02, 2015 09:12 AM

This is not possible. The only way suggested is present in the article.

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html