1

ここに画像の説明を入力

これは私が生成したコードではないため、レポート ビューアーに表示されるエラーはどこで確認できますか? 特に、どのオブジェクトがインスタンスに設定されていないかを知りたいです。

4

2 に答える 2

2

.aspx ページで、イベント ハンドラー OnReportError を ReportViewer 要素に追加します。

<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" style="margin-top: 0px" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="817px" Height="554px"
OnReportError="ReportErrorEventHandler">
    <LocalReport ReportPath="App_Code\Session_subclasses\CustomerPortal\SGTSAssetCatalog.rdlc">
        <DataSources>
            <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                Name="DataSet1" />
        </DataSources>
    </LocalReport>
</rsweb:ReportViewer>

.aspx.cs ページで、イベントを処理するメソッドを追加します。イベントには、e.Exception の下に例外が含まれています。

public void ReportErrorEventHandler(Object sender, ReportErrorEventArgs e)
{
    throw e.Exception;
}

InnerExceptions のパスをたどると、DataSet で指定された接続文字列が開発環境には存在するが、テスト環境には存在しないことがわかりました...この単純な問題の根底に到達するのに十分な時間がかかりました-.-

于 2013-06-03T14:22:30.390 に答える
0

上記が役立つかもしれません。イベント ReportViewer.ReportError イベントを追加してみてください。 http://msdn.microsoft.com/enus/library/microsoft.reporting.webforms.reportviewer.reporterror(v=vs.100).aspx

于 2013-06-03T11:10:03.270 に答える