Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate ASP.NET ReportViewer in a child control in ASP.NET; Document Map button breaks
    primarykey
    data
    text
    <p>We are having a strange issue with the Visual Studio 2008 ReportViewer control. Specifically, when we have a child control on a page, and the child control itself hosts a report viewer, and the report has a document map, the postback on the show/hide document map button seems to be lost, so the document map never disappears. I played with IPostBackEventHandler and didn't seem to get anywhere; the ReportViewer itself implements that interface so I didn't think I cared. Anyway, here's the code:</p> <p>Default.aspx:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ReportViewerDocumentMapButtonStrippedExample._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div runat="server" id="div"&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Default.aspx.cs:</p> <pre><code>using System; namespace ReportViewerDocumentMapButtonStrippedExample { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected override void CreateChildControls() { base.CreateChildControls(); FindControl("div").Controls.Add(new rvControl()); } } } </code></pre> <p>rvControl.cs:</p> <pre><code>using System.Collections.Generic; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using Microsoft.Reporting.WebForms; namespace ReportViewerDocumentMapButtonStrippedExample { public class rvControl : HtmlGenericControl { protected override void CreateChildControls() { base.CreateChildControls(); var rvMain = new ReportViewer { EnableViewState = true, ProcessingMode = ProcessingMode.Remote, ShowRefreshButton = false, AsyncRendering = true, Width = new Unit(100, UnitType.Percentage), Height = new Unit(2000, UnitType.Pixel), ShowCredentialPrompts = false, ID = "viewer", }; rvMain.ServerReport.ReportPath = "/some/report/name"; Controls.Add(rvMain); } } } </code></pre> <p>Anyone have an idea on this?</p>
    singulars
    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.
 

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