Asp:reportviewer do not show in ext.net:Panel

  1. #1

    Asp:reportviewer do not show in ext.net:Panel

    Hello everyone..

    I has a problem and hope someone can help me..

    I add asp:reportviewer in ext:panel.. When i click button to show report, reportview don't show.. If i remove all control ext.net. it work fine.

    here is my code..
    <ext:ResourceManager ID="ResourceManager1" runat="server" DisableViewState="false" />
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <ext:Viewport runat="server" Layout="BorderLayout">
            <Items>
                <ext:Panel ID="pn_West" runat="server" Region="West" Width="360"  Layout="VBoxLayout"
                     Border="true">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
                                <ext:Button ID="cmd_ReportViewer" runat="server" Text="Veiw" Width="70" OnDirectClick="cmd_ReportViewer_Click" />
                                <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server" Margins="0 10 0 0" />
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Items>
                        <ext:FieldSet ID="FieldSet1" runat="server" Padding="5" Title="List" Margin="10"
                            Region="Center" Layout="VBoxLayout">
                            <Items>
                                <ext:ComboBox ID="cb_ReportList" runat="server" FieldLabel="Report name" Width="320"
                                    LabelWidth="120" ValueField="ReportName" DisplayField="Caption" Editable="false"
                                    QueryMode="Local" EnableRegEx="true">
                                    <Store>
                                        <ext:Store ID="Store1" runat="server">
                                            <Model>
                                                <ext:Model ID="Model1" runat="server" IDProperty="ReportName">
                                                    <Fields>
                                                        <ext:ModelField Name="ReportName" Type="String" />
                                                        <ext:ModelField Name="Caption" Type="String" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                    <SelectedItems>
                                        <ext:ListItem Index="0" Mode="Value" />
                                    </SelectedItems>
                                </ext:ComboBox>
                            </Items>
                        </ext:FieldSet>
                    </Items>
                </ext:Panel>
                <ext:Panel ID="pn_re" runat="server" Width="500" Height="400">
                    <Content>
                        <rsweb:ReportViewer ID="ReportViewer2" runat="server" Width="500" Height="600">
                        </rsweb:ReportViewer>
                    </Content>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    CS
    protected void cmd_ReportViewer_Click(object sender, DirectEventArgs e)
        {
            if (!b_Employee.fn_GetAllData())
            {
            }
            else
            {
                string ReportName = "frmReportEmployeeList";
                // ReportGenerator is a Class which create to config automatic for each report.
                ReportGenerator gen = new ReportGenerator(b_Employee.mn_Table, ReportName);
                ReportDataSource ds = new ReportDataSource(ReportName, b_Employee.mn_Table);
                ReportViewer2.Reset();
                ReportViewer2.LocalReport.DataSources.Add(ds);
                ReportViewer2.LocalReport.DisplayName = ReportName;
                ReportViewer2.LocalReport.LoadReportDefinition(gen.GeneraReport(ReportName));
                
            }
        }
    So, what is problem about this? and how can i do?

    Thanks.
    Last edited by dinhhung09138; Feb 22, 2014 at 3:18 AM.
  2. #2
    Hi @dinhhung09138,

    If i remove all control ext.net.
    So, you provably use a standard ASP.NET Button's Click event, right? It is not the same as a DirectEvent. In the case with a DirectEvent you should explicitly do something to update the control, otherwise it won't be updated automatically.

    I would try to call:
    this.pn_re.UpdateContent();
  3. #3
    You could also just try calling .Update() on the ReportViewer.

    this.ReportViewer2.Update();
    Hope this helps.
    Geoffrey McGill
    Founder & CEO

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. Replies: 1
    Last Post: Jan 31, 2012, 8:45 AM
  4. ReportViewer error when add a report
    By cmujica in forum 1.x Help
    Replies: 6
    Last Post: Jan 06, 2012, 6:28 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