Visual Studio 2008 ReportViewer コントロールで奇妙な問題が発生しています。具体的には、ページに子コントロールがあり、子コントロール自体がレポート ビューアーをホストし、レポートにドキュメント マップがある場合、[ドキュメント マップの表示/非表示] ボタンのポストバックが失われるように見えるため、ドキュメント マップは決して表示されません。消えます。私は IPostBackEventHandler で遊んだが、どこにも行かないようだった。ReportViewer 自体がそのインターフェイスを実装しているので、気にしているとは思いませんでした。とにかく、ここにコードがあります:
デフォルト.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ReportViewerDocumentMapButtonStrippedExample._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div runat="server" id="div">
</div>
</form>
</body>
</html>
Default.aspx.cs:
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());
}
}
}
rvControl.cs:
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);
}
}
}
誰でもこれについて考えがありますか?