Note that there are some explanatory texts on larger screens.

plurals
  1. POMissing Subreports when RDLC is moved to server
    primarykey
    data
    text
    <p>I'm having a hard time getting a sub report to show up in my application using reportviewer. It works perfectly when debugging it locally. But when I upload it to the server, the sub reports are blank. </p> <p>I've believe that SubreportProcessing event is not firing since I don't see the stored procedures getting fired from SQL Server Profiler. Here is my code that I'm using.</p> <pre><code>private void RunReport(string strFormat, int PlanID) { const string reportrdlc = "Reports\\Report_All_Sections.rdlc"; LocalReport report = new LocalReport {ReportPath = Server.MapPath(reportrdlc)}; report.SetBasePermissionsForSandboxAppDomain(new PermissionSet(PermissionState.Unrestricted)); report.DataSources.Clear(); report.SubreportProcessing += SetSubDataSource; report.DataSources.Add(new ReportDataSource("DataSet_usp_GetSD", _wpt.Get_SD(PlanID).Copy())); report.Refresh(); string mimeType; string encoding; string fileNameExtension; string[] streams; Warning[] warnings; byte[] pdfContent = report.Render(strFormat, null, out mimeType, out encoding, out fileNameExtension, out streams, out warnings); System.IO.MemoryStream stream = new System.IO.MemoryStream(pdfContent); Response.ContentType = strFormat == "EXCEL" ? "application/vnd.ms-excel" : "application/pdf"; Response.BinaryWrite(stream.ToArray()); Response.Flush(); Response.Close(); stream.Close(); } public void SetSubDataSource(object sender, SubreportProcessingEventArgs e) { int PlanID = 1; if (Request.QueryString["PlanID"] != null) { try { PlanID = Convert.ToInt32(Request.QueryString["PlanID"]); } catch (Exception Ex) { PlanID = 1; } } switch (e.ReportPath) { case "Report_All_Mentor": e.DataSources.Add(new ReportDataSource("DataSet_usp_GetMC", _wpt.Get_MC(PlanID).Copy())); break; case "Report_All_Intern": e.DataSources.Add(new ReportDataSource("DataSet_usp_GetEA", _wpt.Get_EA(PlanID).Copy())); break; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload