Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my aspx code:


XML
<tel:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <tel:AjaxSetting AjaxControlID="fbPrintBiomassReport">
                <UpdatedControls>
                    <tel:AjaxUpdatedControl LoadingPanelID="ApplicationWideLoadingPanel" ControlID="fbPrintBiomassReport" />
                </UpdatedControls>
            </tel:AjaxSetting>
        </AjaxSettings>
    </tel:RadAjaxManagerProxy>

<rfp:FormPanel ID="fpPrintReports" runat="server" Title="Biomass Report">
                <asp:UpdatePanel ID="upReportViewer" runat="server">
                    <ContentTemplate>
<rfp:FormButton runat="server" ID="fbPrintBiomassReport" Type="Print" Text="Print Report" OnClick="fbPrintBiomassReport_Click" />
                <asp:UpdatePanel runat="server" ID="rpViewer3">
                    <ContentTemplate>
                        <rsweb:ReportViewer ID="rvReport" runat="server" AsyncRendering="false" ShowParameterPrompts="false" Height="780px" Width="100%" ProcessingMode="Remote"></rsweb:ReportViewer>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </rfp:FormPanel>




Here is my code behind script:

C#
protected void fbPrintBiomassReport_Click(object sender, EventArgs e)
        {
            rvReport.Reset();
            rvReport.Visible = false;
            if (!string.IsNullOrEmpty(rcProjectGearCatch.SelectedValue))
            {
                List<ReportParameter> parameterList = new List<ReportParameter>();

                parameterList.Add(new ReportParameter("CatchID", rcProjectGearCatch.SelectedValue));
                rvReport.ServerReport.ReportServerCredentials = new SciCollReportServerCredentials();
                //rvReport.PageCountMode = Microsoft.Reporting.WebForms.PageCountMode.Actual;
                rvReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServer"]);
                rvReport.ServerReport.ReportPath = "/" + ConfigurationManager.AppSettings["ReportsRootPath"] + "/SciColl/" + "BiomassReport";
                rvReport.ServerReport.SetParameters(parameterList);
                rvReport.ServerReport.Refresh();
                rvReport.Visible = true;
            }
        }






XML
I am having an issue below while I am doing any postback event.

    Sys.InvalidOperationException: Could not find UpdatePanel with ID
    'ctl00_PageContent_rvReport_ReportViewer'. If it is being updated dynamically then it
    must be inside another UpdatePanel.

Here is my aspx code:

<tel:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <tel:AjaxSetting AjaxControlID="fbPrintBiomassReport">
                <UpdatedControls>
                    <tel:AjaxUpdatedControl LoadingPanelID="ApplicationWideLoadingPanel" ControlID="fbPrintBiomassReport" />
                </UpdatedControls>
            </tel:AjaxSetting>
        </AjaxSettings>
    </tel:RadAjaxManagerProxy>

<rfp:FormPanel ID="fpPrintReports" runat="server" Title="Biomass Report">
                <asp:UpdatePanel ID="upReportViewer" runat="server">
                    <ContentTemplate>
<rfp:FormButton runat="server" ID="fbPrintBiomassReport" Type="Print" Text="Print Report" OnClick="fbPrintBiomassReport_Click" />
                <asp:UpdatePanel runat="server" ID="rpViewer3">
                    <ContentTemplate>
                        <rsweb:ReportViewer ID="rvReport" runat="server" AsyncRendering="false" ShowParameterPrompts="false" Height="780px" Width="100%" ProcessingMode="Remote"></rsweb:ReportViewer>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </rfp:FormPanel>

Here is my code behind script:

protected void fbPrintBiomassReport_Click(object sender, EventArgs e)
        {
            rvReport.Reset();
            rvReport.Visible = false;
            if (!string.IsNullOrEmpty(rcProjectGearCatch.SelectedValue))
            {
                List<ReportParameter> parameterList = new List<ReportParameter>();

                parameterList.Add(new ReportParameter("CatchID", rcProjectGearCatch.SelectedValue));
                rvReport.ServerReport.ReportServerCredentials = new SciCollReportServerCredentials();
                //rvReport.PageCountMode = Microsoft.Reporting.WebForms.PageCountMode.Actual;
                rvReport.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings["ReportServer"]);
                rvReport.ServerReport.ReportPath = "/" + ConfigurationManager.AppSettings["ReportsRootPath"] + "/SciColl/" + "BiomassReport";
                rvReport.ServerReport.SetParameters(parameterList);
                rvReport.ServerReport.Refresh();
                rvReport.Visible = true;
            }
        }

Has any of you known the solution for that? Please help. Thanks In advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900