SSRS reportviewer +panel reportviewer don't changed ReportPath in server side

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    SSRS reportviewer +panel reportviewer don't changed ReportPath in server side

    I want to put reportviewer on panel content, have a treepanel control, click node, can change the reportviewer reportpath. But can't userful in server side, can't change the reportviewer reportpath, how to do?
    Examples are as follows:



    <body>
        <form runat="server">
        <%--  <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePartialRendering="true">
        </ajax:ToolkitScriptManager>--%>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <asp:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="true">
        </asp:ScriptManager>
        <ext:Viewport ID="Viewport1" runat="server" Layout="border">
            <Items>
                <ext:ColumnLayout ID="ColumnLayout1" runat="server" Split="true">
                    <Columns>
                        <ext:LayoutColumn ColumnWidth="0.2">
                            <ext:Panel ID="Panel2" runat="server" Region="West" Width="200" Header="false" Collapsible="true"
                                Split="true" CollapseMode="Mini" Margins="0 0 4 4" Layout="Fit">
                                <Items>
                                    <ext:TreePanel ID="reportTree" runat="server" Header="false" AutoScroll="true" Lines="false"
                                        UseArrows="true" CollapseFirst="false" ContainerScroll="true" RootVisible="false">
                                        <TopBar>
                                            <ext:Toolbar ID="Toolbar1" runat="server">
                                                <Items>
                                                    <ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true" Width="150"
                                                        EmptyText="过滤报表...">
                                                        <Triggers>
                                                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                                        </Triggers>
                                                        <Listeners>
                                                            <KeyUp Fn="filterTree" Buffer="100" />
                                                            <TriggerClick Fn="clearFilter" />
                                                            <SpecialKey Fn="filterSpecialKey" />
                                                        </Listeners>
                                                    </ext:TriggerField>
                                                </Items>
                                            </ext:Toolbar>
                                        </TopBar>
                                        <Listeners>
                                            <Click Handler="getReportId(node.text);" />
                                        </Listeners>
                                        <DirectEvents>
                                            <Click OnEvent="TreePanelClick">
                                            </Click>
                                        </DirectEvents>
                                    </ext:TreePanel>
                                </Items>
                            </ext:Panel>
                        </ext:LayoutColumn>
                        <ext:LayoutColumn ColumnWidth="1">
                            <ext:Panel runat="server">
                                <Content>
                                    <ext:RowLayout ID="RowLayout1" runat="server">
                                        <Rows>
                                            <ext:LayoutRow RowHeight="0.15">
                                                <ext:Panel ID="QueryPanel" runat="server" Frame="false" Border="false">
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                            <ext:LayoutRow>
                                                <ext:Panel ID="SouthPanel" runat="server" Title="South" Padding="6" RowHeight="0.85">
                                                    <Content>
                                                        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" AsyncRendering="true"
                                                            ZoomPercent="100" ShowToolBar="True" InternalBorderColor="Transparent" PromptAreaCollapsed="True"
                                                            ShowParameterPrompts="False" ShowExportControls="True" ShowPrintButton="true"
                                                            Height="999px" SizeToReportContent="False" ShowRefreshButton="false" Width="100%"
                                                            KeepSessionAlive="true">
                                                            <%--  <ServerReport ReportServerUrl="172.16.100.37/reportserver" ReportPath="/抗菌传统报表/某科抗菌药物临床使用前十名" />--%>
                                                        </rsweb:ReportViewer>
                                                    </Content>
                                                    <LoadMask ShowMask="true" Msg="正在生成报表..." />
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                        </Rows>
                                    </ext:RowLayout>
                                </Content>
                            </ext:Panel>
                        </ext:LayoutColumn>
                    </Columns>
                </ext:ColumnLayout>
            </Items>
        </ext:Viewport>
        <asp:HiddenField ID="reportId" runat="server" />
        <%--    <ext:Panel ID="QueryPanel" runat="server" Frame="false" Border="false">
        </ext:Panel>--%>
        <%--       //参数控件--%>
        <%-- <div id="man_zone" class="man_zone" style="min-height: 55px; border: 1px; overflow: auto;">
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" AsyncRendering="true"
                ZoomMode="FullPage" ShowToolBar="True" InternalBorderColor="Transparent" PromptAreaCollapsed="True"
                ShowParameterPrompts="False" ShowExportControls="True" ShowPrintButton="true"
                Height="100%" SizeToReportContent="False" ShowRefreshButton="false" Width="100%"
                KeepSessionAlive="true">
                <ServerReport ReportServerUrl="172.16.100.37/reportserver" ReportPath="/抗菌传统报表/某科抗菌药物临床使用前十名" />
            </rsweb:ReportViewer>
        </div>--%>
        <%--       //报表展示--%>
        <script language="javascript" type="text/javascript">
            Ext.form.ComboBox.prototype.filter = function (field, value) {
                var ds = this.store;
                ds.filter(field, value, true, true);
                ds.realSnapshot = ds.snapshot;
                ds.snapshot = ds.data;
            };
            Ext.form.ComboBox.prototype.clearFilter = function (suppressEvent) {
                var ds = this.store;
                if (ds.realSnapshot && ds.realSnapshot != ds.snapshot) {
                    ds.snapshot = ds.realSnapshot;
                    delete ds.realSnapshot;
                }
                ds.clearFilter(suppressEvent);
            };
        </script>
        </form>
    </body>
    server side:

    
            protected void Page_Load(object sender, EventArgs e)
            {
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://172.16.100.37/reportserver");
                ReportViewer1.ServerReport.ReportPath = "/抗菌传统报表/某科抗菌药物临床使用前十名";
            }
    
     /// <summary>
            /// 报表树单击事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            public void TreePanelClick(object sender, Ext.Net.DirectEventArgs e)
            {
                string strReportText = reportId.Value;
                List<WebNavigation> selectReport = AllWebNavigationList.FindAll(g => g.Name == strReportText);
                if (selectReport != null && selectReport.Count > 0)
                    ShowReport(selectReport[0]);
            }
            [Ext.Net.DirectMethod]
            public void ShowReport(WebNavigation report)
            {
    
                ReportGetBack();
                ReportViewerCredentials rvwCreds = new ReportViewerCredentials("liaolian", "123qwe", "zesing");
                ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
                //ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(strReporServertUrl);
                this.ReportViewer1.ServerReport.ReportPath = ((Zesing.Common.Entities.Report)report.BindReport).ReportTemplate.Value;
      this.ReportViewer1.ServerReport.Refresh();
         }
  2. #2
    Quote Originally Posted by liaolian9948 View Post
    I want to put reportviewer on panel content, have a treepanel control, click node, can change the reportviewer reportpath. But can't userful in server side, can't change the reportviewer reportpath, how to do?
    Examples are as follows:



    <body>
        <form runat="server">
        <%--  <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePartialRendering="true">
        </ajax:ToolkitScriptManager>--%>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <asp:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="true">
        </asp:ScriptManager>
        <ext:Viewport ID="Viewport1" runat="server" Layout="border">
            <Items>
                <ext:ColumnLayout ID="ColumnLayout1" runat="server" Split="true">
                    <Columns>
                        <ext:LayoutColumn ColumnWidth="0.2">
                            <ext:Panel ID="Panel2" runat="server" Region="West" Width="200" Header="false" Collapsible="true"
                                Split="true" CollapseMode="Mini" Margins="0 0 4 4" Layout="Fit">
                                <Items>
                                    <ext:TreePanel ID="reportTree" runat="server" Header="false" AutoScroll="true" Lines="false"
                                        UseArrows="true" CollapseFirst="false" ContainerScroll="true" RootVisible="false">
                                        <TopBar>
                                            <ext:Toolbar ID="Toolbar1" runat="server">
                                                <Items>
                                                    <ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true" Width="150"
                                                        EmptyText="过滤报表...">
                                                        <Triggers>
                                                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                                                        </Triggers>
                                                        <Listeners>
                                                            <KeyUp Fn="filterTree" Buffer="100" />
                                                            <TriggerClick Fn="clearFilter" />
                                                            <SpecialKey Fn="filterSpecialKey" />
                                                        </Listeners>
                                                    </ext:TriggerField>
                                                </Items>
                                            </ext:Toolbar>
                                        </TopBar>
                                        <Listeners>
                                            <Click Handler="getReportId(node.text);" />
                                        </Listeners>
                                        <DirectEvents>
                                            <Click OnEvent="TreePanelClick">
                                            </Click>
                                        </DirectEvents>
                                    </ext:TreePanel>
                                </Items>
                            </ext:Panel>
                        </ext:LayoutColumn>
                        <ext:LayoutColumn ColumnWidth="1">
                            <ext:Panel runat="server">
                                <Content>
                                    <ext:RowLayout ID="RowLayout1" runat="server">
                                        <Rows>
                                            <ext:LayoutRow RowHeight="0.15">
                                                <ext:Panel ID="QueryPanel" runat="server" Frame="false" Border="false">
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                            <ext:LayoutRow>
                                                <ext:Panel ID="SouthPanel" runat="server" Title="South" Padding="6" RowHeight="0.85">
                                                    <Content>
                                                        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" AsyncRendering="true"
                                                            ZoomPercent="100" ShowToolBar="True" InternalBorderColor="Transparent" PromptAreaCollapsed="True"
                                                            ShowParameterPrompts="False" ShowExportControls="True" ShowPrintButton="true"
                                                            Height="999px" SizeToReportContent="False" ShowRefreshButton="false" Width="100%"
                                                            KeepSessionAlive="true">
                                                            <%--  <ServerReport ReportServerUrl="172.16.100.37/reportserver" ReportPath="/抗菌传统报表/某科抗菌药物临床使用前十名" />--%>
                                                        </rsweb:ReportViewer>
                                                    </Content>
                                                    <LoadMask ShowMask="true" Msg="正在生成报表..." />
                                                </ext:Panel>
                                            </ext:LayoutRow>
                                        </Rows>
                                    </ext:RowLayout>
                                </Content>
                            </ext:Panel>
                        </ext:LayoutColumn>
                    </Columns>
                </ext:ColumnLayout>
            </Items>
        </ext:Viewport>
        <asp:HiddenField ID="reportId" runat="server" />
        <%--    <ext:Panel ID="QueryPanel" runat="server" Frame="false" Border="false">
        </ext:Panel>--%>
        <%--       //参数控件--%>
        <%-- <div id="man_zone" class="man_zone" style="min-height: 55px; border: 1px; overflow: auto;">
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" AsyncRendering="true"
                ZoomMode="FullPage" ShowToolBar="True" InternalBorderColor="Transparent" PromptAreaCollapsed="True"
                ShowParameterPrompts="False" ShowExportControls="True" ShowPrintButton="true"
                Height="100%" SizeToReportContent="False" ShowRefreshButton="false" Width="100%"
                KeepSessionAlive="true">
                <ServerReport ReportServerUrl="172.16.100.37/reportserver" ReportPath="/抗菌传统报表/某科抗菌药物临床使用前十名" />
            </rsweb:ReportViewer>
        </div>--%>
        <%--       //报表展示--%>
        <script language="javascript" type="text/javascript">
            Ext.form.ComboBox.prototype.filter = function (field, value) {
                var ds = this.store;
                ds.filter(field, value, true, true);
                ds.realSnapshot = ds.snapshot;
                ds.snapshot = ds.data;
            };
            Ext.form.ComboBox.prototype.clearFilter = function (suppressEvent) {
                var ds = this.store;
                if (ds.realSnapshot && ds.realSnapshot != ds.snapshot) {
                    ds.snapshot = ds.realSnapshot;
                    delete ds.realSnapshot;
                }
                ds.clearFilter(suppressEvent);
            };
        </script>
        </form>
    </body>
    server side:

    
            protected void Page_Load(object sender, EventArgs e)
            {
                ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://172.16.100.37/reportserver");
                ReportViewer1.ServerReport.ReportPath = "/抗菌传统报表/某科抗菌药物临床使用前十名";
            }
    
     /// <summary>
            /// 报表树单击事件
            /// </summary>
            /// <param name="sender"></param>
            /// <param name="e"></param>
            public void TreePanelClick(object sender, Ext.Net.DirectEventArgs e)
            {
                string strReportText = reportId.Value;
                List<WebNavigation> selectReport = AllWebNavigationList.FindAll(g => g.Name == strReportText);
                if (selectReport != null && selectReport.Count > 0)
                    ShowReport(selectReport[0]);
            }
            [Ext.Net.DirectMethod]
            public void ShowReport(WebNavigation report)
            {
    
                ReportGetBack();
                ReportViewerCredentials rvwCreds = new ReportViewerCredentials("liaolian", "123qwe", "zesing");
                ReportViewer1.ServerReport.ReportServerCredentials = rvwCreds;
                //ReportViewer1.ProcessingMode = ProcessingMode.Remote;
                this.ReportViewer1.ServerReport.ReportServerUrl = new Uri(strReporServertUrl);
                this.ReportViewer1.ServerReport.ReportPath = ((Zesing.Common.Entities.Report)report.BindReport).ReportTemplate.Value;
      this.ReportViewer1.ServerReport.Refresh();
         }
    please help me !!

Similar Threads

  1. Replies: 5
    Last Post: Apr 28, 2012, 5:21 AM
  2. Replies: 7
    Last Post: Apr 26, 2012, 5:39 PM
  3. ReportViewer error when add a report
    By cmujica in forum 1.x Help
    Replies: 6
    Last Post: Jan 06, 2012, 6:28 PM
  4. Replies: 0
    Last Post: Nov 17, 2010, 9:32 PM
  5. Panel + ReportViewer
    By Kipetcoff in forum 1.x Help
    Replies: 1
    Last Post: Jan 27, 2009, 3:52 AM

Tags for this Thread

Posting Permissions