简体   繁体   中英

VS Reporting - Report Viewer Does not work with ASP:Panel

I am completely new to using VS reports but ive muddled my way through creating the RDLC and the report viewer.

My question is I've set up the report to use a data source from an SP in the RDLC page, but as soon as I put the control in a panel so I can switch visibility on and off the control stops displaying????

in the source code of the failed page I can see...

<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client side framework failed to load.');
//]]>
</script>

I don't understand why being in a panel screws up the control

AHHHHH

here is the code

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
                    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Panel runat="server" ID="ReportHeaders" Visible="true">
        <h2>Driver Lateness Report</h2><br />
        <h3>Set Parameters</h3>
        <br />
        <br />
        <center>
        <asp:RadioButtonList ID="rbl_datechoice" runat="server">
        <asp:ListItem Text="Yesterday"></asp:ListItem>
        <asp:ListItem Text="Today"></asp:ListItem>
        <asp:ListItem Text="DateRange" Enabled="false"></asp:ListItem>
        </asp:RadioButtonList>
        <br />
        Select Site :- &nbsp <asp:DropDownList runat="server"></asp:DropDownList>
        <br />
        <br />
        <asp:Button ID="btn_Run_Report" runat="server" OnClick="Btn_Run_Report_Click" Text="Run Report" /></center>
        </asp:Panel>
        <asp:Panel ID="ReportDetails" runat="server" Visible="false">
        <table><tr><td>
            <rsweb:ReportViewer ID="Rpt_Report" runat="server" Font-Names="Verdana" 
                Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
                WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" 
                EnableTheming="True" ShowToolBar="False" ShowWaitControlCancelLink="False" 
                ShowZoomControl="False" style="margin-right: 0px" Width="917px">
                <LocalReport ReportPath="Reports\Late\Lateness.rdlc">
                    <DataSources>
                        <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
                    </DataSources>
                </LocalReport>
            </rsweb:ReportViewer>

<div style="min-height:100px"/>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:CNS %>" SelectCommand="Rep_Lateness" 
                SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:Parameter Name="siteid" Type="Int32" DefaultValue="1" />
                    <asp:Parameter Name="date" Type="String" DefaultValue="12-12-2014" />
                </SelectParameters>
            </asp:SqlDataSource>
            </td></tr></table>
            </asp:Panel>
</asp:Content>

Once I get this working I can get the params to pass into the SP properly in the Behind Code

Any one have any ideas?

如果还有其他人遇到这个问题,我找不到答案,所以唯一的解决办法是有2个单独的页面,一个用于参数,另一个用于报表。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM