在radgrid内导出radgrid时页脚出现在顶部

时间:2015-05-03 18:36:09

标签: html asp.net

我在radgrid里面有一个radgrid。在导出到excel或word时,页脚将出现在数据行的顶部,即首先是页脚,然后是行。 请帮帮我。下面是代码片段。

                BorderStyle="None"
                PageSize="50"                        
                AllowPaging="true"
                 ShowFooter="false"
                OnNeedDataSource="rgMonthlyBalancingPools_OnNeedDataSource"
                OnPdfExporting="rgMonthlyBalancingPools_PdfExporting"
                OnGridExporting="rgMonthlyBalancingPools_GridExporting"


                runat="server">

    <ExportSettings FileName="NonFirmMonthlyBalancingPools" 
                    OpenInNewWindow="true" ExportOnlyData="false" 
                    >
        <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" FileExtension="csv" />
        <Pdf PageWidth="350mm" PageHeight="210mm" />
    </ExportSettings>

<MasterTableView AutoGenerateColumns="true" >

    <ItemTemplate>

        <div>

            <h3>Pool Summary</h3>
            <telerik:RadGrid    ID="rgPoolSummary" 
                                AllowSorting="true"
                                AutoGenerateColumns="false"
                                ShowFooter="true"                                    
                                AllowPaging="false"
                                CssClass="AutoShrink"
                                EnableNoRecordsTemplate="True"
                                OnItemCommand="rg_ItemCommand"
                                OnNeedDataSource="rgPoolSummary_OnNeedDataSource"
                                runat="server">
                <ExportSettings FileName="NonFirmMonthlyBalancingPoolSummary" 
                                OpenInNewWindow="true"  ExportOnlyData="true" IgnorePaging="true">
                    <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" FileExtension="csv" />
                </ExportSettings>
                <MasterTableView CssClass="AutoShrink" CommandItemDisplay="Top" GridLines="Both" BorderStyle="Solid">
                    <Columns>
                <telerik:GridBoundColumn DataField="ServiceClass" 
                        FilterControlAltText="Filter column column" HeaderText="Service Class" 
                        UniqueName="column"  FooterText="Total">
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalCustomers" 
                        HeaderText="Total Customers" SortExpression="TotalCustomers" Aggregate="Sum" AllowSorting="True" FooterText=" ">  
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />                                                         
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Walf" 
                        DataFormatString="{0:0.0000;(0.0000);0.0000}" HeaderText="WALF" 
                        SortExpression="Walf" Aggregate="Sum" FooterText=" " >
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />                                                        
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalAnnualLoadWithoutUFG" HeaderText="Total Annual Load w/o UFG (dt)" 
                        SortExpression="TotalAnnualLoadWithoutUFG" Aggregate="Sum" FooterText=" " 
                        DataFormatString="{0:0.0;(0.0);0.0}"
                        FooterAggregateFormatString="{0:0.0;(0.0);0.0}">  
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />                                                      
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalBaseWithoutUFG" 
                        HeaderText="Base w/o UFG (dt)" SortExpression="TotalBaseWithoutUFG" 
                        Aggregate="Sum" FooterText=" " 
                        DataFormatString="{0:0.0000;(0.0000);0.0000}" FooterAggregateFormatString="{0:0.0000;(0.0000);0.0000}">
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />                                                         
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalThermalResponseWithoutUFG" 
                        HeaderText="Thermal Response w/o UFG (dt)" 
                        SortExpression="TotalThermalResponseWithoutUFG" Aggregate="Sum" FooterText=" " 
                        DataFormatString="{0:0.00000;(0.00000);0.00000}" FooterAggregateFormatString="{0:0.00000;(0.00000);0.00000}">                                                        
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalMonthlyDeliveryQuantityWithoutUFG" 
                        HeaderText="Total Monthly Delivery Quantity w/o UFG (dt)" 
                        SortExpression="TotalMonthlyDeliveryQuantityWithoutUFG" Aggregate="Sum" FooterText=" " 
                        DataFormatString="{0:0.0;(0.0);0.0}" FooterAggregateFormatString="{0:0.0;(0.0);0.0}"> 
                        <ItemStyle HorizontalAlign="left" />
                        <FooterStyle HorizontalAlign="left" />                                                        
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TotalMonthlyDeliveryQuantityWithUFG" 
                    HeaderText="Total Monthly Delivery Quantity w/UFG (dt)" 
                    SortExpression="TotalMonthlyDeliveryQuantityWithUFG" Aggregate="Sum" FooterText=" " 
                    DataFormatString="{0:0.0;(0.0);0.0}" FooterAggregateFormatString="{0:0.0;(0.0);0.0}"> 
                    <ItemStyle HorizontalAlign="left" />
                    <FooterStyle HorizontalAlign="left" />                                                       
                </telerik:GridBoundColumn>  
                <telerik:GridBoundColumn DataField="TotalDDQwithUFG" 
                    FilterControlAltText="Filter column1 column" HeaderText="Total DDQ w/UFG (dt)" 
                    SortExpression="TotalDDQwithUFG" UniqueName="column1" Aggregate="Sum" FooterText=" ">
                    <ItemStyle HorizontalAlign="left" />
                    <FooterStyle HorizontalAlign="left" /> 
                </telerik:GridBoundColumn>
            </Columns>

                    <CommandItemTemplate>

                        <asp:LinkButton ID="lbtnCsv"
                                        style="font-size:80%;"
                                        CommandName="CsvExport" 
                                        runat="server">
                            <img id="imgExportToCsv"
                                 alt="Export to CSV" 
                                 src="~/Images/reporting.gif" 
                                 runat="server" />               
                             Export to CSV
                        </asp:LinkButton>

                    </CommandItemTemplate>
                </MasterTableView>
            </telerik:RadGrid>
        </div>

</MasterTableView>

0 个答案:

没有答案
相关问题