title: Show loading screen before dynamically created PDF
body: <p>I have a view that is, instead of returning a <code>View()</code>, is returning a dynamically created PDF and then showing the PDF in a new tab. I'm not saving the PDF anywhere, or storing it anywhere. What I would like to do is have a loading screen show up while the PDF is being created. Can this be done?</p>
  
  <pre><code>public ActionResult SolicitorActionReport_Load(SolicitorActionParamsViewModel viewModel) {
      var cultivationModel = new CultivationModel(viewModel, ConstituentRepository, CampaignRepository);
      var cultivationData = cultivationModel.GetCultivationActivityData();
      var reportParamModel = new List&lt;ReportParamModel&gt;
                                     {new ReportParamModel {AgencyName = SelectedUserAgency.AgencyName, StartDate = viewModel.StartDate, EndDate = viewModel.EndDate}};
  
      var reportToRun = "ActionDateCultivationReport";
      if (viewModel.SortActionBy == SolicitorActionReportSortType.Constituent) {
          reportToRun = "ConstituentCultivationReport";
      } else if (viewModel.SortActionBy == SolicitorActionReportSortType.Solicitor) {
          reportToRun = "SolicitorCultivationReport";
      }
  
      return FileContentPdf("Constituent", reportToRun, cultivationData, reportParamModel, new List&lt;FundraisingAppealMassSummary&gt;(), new List&lt;FundraisingAppealPortfolioSummary&gt;());
  }
  
  
  
  public FileContentResult FileContentPdf(string folder, string reportName, object dataSet,object reportParamModel,object appealMassDataSet, object appealPortfolioDataSet) {
      var localReport = new LocalReport();
      localReport.ReportPath = Server.MapPath("~/bin/Reports/" + folder + "/rpt" + reportName + ".rdlc");
      var reportDataSource = new ReportDataSource(reportName + "DataSet", dataSet);
  
      var reportParamsDataSource = new ReportDataSource("ReportParamModelDataSet", reportParamModel);
      var reportParamsDataSourceMass = new ReportDataSource("FundraisingAppealMassSummaryDataSet", appealMassDataSet);
      var reportParamsDataSourcePortfolio = new ReportDataSource("FundraisingAppealPortfolioSummaryDataSet", appealPortfolioDataSet);
  
      #region Setting ReportViewControl
  
      localReport.DataSources.Add(reportDataSource);
      localReport.DataSources.Add(reportParamsDataSource);
      localReport.DataSources.Add(reportParamsDataSourceMass);
      localReport.DataSources.Add(reportParamsDataSourcePortfolio);
  
      localReport.SubreportProcessing += (s, e) =&gt; { e.DataSources.Add(reportDataSource); };
  
      string reportType = "pdf";
      string mimeType;
      string encoding;
      string fileNameExtension;
      //The DeviceInfo settings should be changed based on the reportType             
      //http://msdn2.microsoft.com/en-us/library/ms155397.aspx             
      string deviceInfo = "&lt;DeviceInfo&gt;&lt;OutputFormat&gt;PDF&lt;/OutputFormat&gt;&lt;/DeviceInfo&gt;";
      Warning[] warnings;
      string[] streams;
      byte[] renderedBytes;
      //Render the report             
      renderedBytes = localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);
  
      #endregion
  
      return File(renderedBytes, mimeType);
  }
  </code></pre>