0

visible=falseレポート ビューアーに問題があります。イベント ボタンのクリック時に page_load ページのようにレポート ビューアーを設定した場合、既に に設定しvisible=trueている場合でも、レポート ビューアーは作成されますvisible= false。誰でもこの問題を解決できますか? または他の解決策があります..私はaspxページに2つのレポートビューアーを持っていますが、そのうちの1つがvisible=falsepage_loadにある必要があります. ここにコードがあります..ありがとうございます

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindDdlCountryValue();

            ReportViewer_TotalCountry.Visible = false;


        }

protected void btnViewReport_Click2(object sender, EventArgs e)
    {

            ReportViewer_TTFSSummaryBasedOnCountry.LocalReport.Refresh();
            ReportViewer_TTFSSummaryBasedOnCountry.Visible = true;
            ReportViewer_TotalCountry.Visible = false;

    }

    protected void btn_AllCountry_Click(object sender, EventArgs e)
    {

            ReportViewer_TotalCountry.LocalReport.Refresh();
            ReportViewer_TTFSSummaryBasedOnCountry.Visible = false;
            ReportViewer_TotalCountry.Visible = true;

    }

ご覧のとおり、クリックbtn_AllCountry_Clickすると、 ReportViewer_TotalCountry.Visible = true; 病気のまま表示されます= false :(

助けてください..私はこのレポートに不慣れです:'(


 <div>
    <rsweb:ReportViewer ID="ReportViewer_TTFSSummaryBasedOnCountry" runat="server" Font-Names="Verdana" Font-Size="8pt"
     InteractiveDeviceInfos="(Collection)" SizeToReportContent="True" WaitMessageFont-Names="Verdana" 6WaitMessageFont-Size="14pt" >
        <LocalReport ReportPath="RDLC\TTFSSummaryBasedOnCountry_Report.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="ObjectDataSource_TTFSSummaryBasedOnCountry" 
                    Name="TTFSSummaryBasedOnCountry_DataSet" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>
    <asp:ObjectDataSource ID="ObjectDataSource_TTFSSummaryBasedOnCountry" 
        runat="server" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetData" 
        TypeName="IMP_report.ttfsListTableAdapters.TTFSSummaryBasedOnCountryTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList_Country" Name="CountryName" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</div>
<div id="TotalCountry" align="center" >
<rsweb:ReportViewer ID="ReportViewer_TotalCountry" runat="server" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
  WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" SizeToReportContent="True" >
    <LocalReport ReportPath="RDLC\TTFSSummaryBasedOnCountry_Report.rdlc">
        <DataSources>
            <rsweb:ReportDataSource DataSourceId="ObjectDataSource_ttfsSummaryTotalCountry" 
                Name="TTFSSummaryBasedOnCountry_DataSet" />
        </DataSources>
    </LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource_ttfsSummaryTotalCountry" 
    runat="server" OldValuesParameterFormatString="original_{0}" 
    SelectMethod="GetData" 
    TypeName="IMP_report.ttfsListTableAdapters.TTFSSummaryBasedOnCountryTotalTableAdapter">
</asp:ObjectDataSource>
</div>
4

2 に答える 2

2

私が使用するいくつかのレポートで:

rptViewer.ShowReportBody = false;の上Page_Load

rptViewer.ShowReportBody = true;オンbutton_click

私はそれがあなたの問題を解決すると思います。

于 2013-05-29T12:40:12.303 に答える
0

この種の問題の解決策があります. の設定Visibilityの代わりにReportViewer. Visibility次のようにDivコントロールを設定してみてください

<div id="TotalSummary" runat="server" >
    <rsweb:ReportViewer ID="ReportViewer_TTFSSummaryBasedOnCountry" runat="server">
    </rsweb:ReportViewer>
</div>
<div id="TotalCountry" align="center" runat="server" >
    <rsweb:ReportViewer ID="ReportViewer_TotalCountry" runat="server" >
    </rsweb:ReportViewer>
</div>

ReportViewer VisibilityAny をtoTrueまたはFalsethen this の代わりに設定したい場合は、DivVisibility を設定してみてください。

注: Not forget to use runat="server" under div tag.

ご理解とご協力をお願いいたします。

于 2013-05-17T07:41:00.067 に答える