Hello,
I am currently exporting a aspx page to excel using the below code. This page has multiple RadGrids on it with Headers and Footers. The Problem I am having is that when Exporting to Excel it is putting the Footer row ABOVE the rad grid instead of at the Bottom. Is there a way of correcting this or a work around? Thank you.
This is On Page Load of a GenerateReport.aspx Page which gets called by the ASPX page which is what I am trying to export to excel.
This is one of the RadGrids currently on a aspx page which I am trying to export by doing the server.execute Above.
I am currently exporting a aspx page to excel using the below code. This page has multiple RadGrids on it with Headers and Footers. The Problem I am having is that when Exporting to Excel it is putting the Footer row ABOVE the rad grid instead of at the Bottom. Is there a way of correcting this or a work around? Thank you.
This is On Page Load of a GenerateReport.aspx Page which gets called by the ASPX page which is what I am trying to export to excel.
| Response.Clear() |
| Response.Charset = "" |
| ''set the response mime type for excel |
| Response.ContentType = "application/vnd.ms-excel" |
| HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=1.xls") |
| Dim sw As New StringWriter |
| Server.Execute(Session("ReportFile"), sw) |
| Response.Write(sw.ToString.Replace("<div", "<span").Replace("</div", "</span").Replace("<input id=""ctl00_PageContent", "<span id=""ctl00_PageContent")) |
| Response.End() |
This is one of the RadGrids currently on a aspx page which I am trying to export by doing the server.execute Above.
| <telerik:RadGrid ID="dgMonth" runat="server" ShowGroupPanel="False" RecordType="Deposit" AutoGenerateColumns="True" EnableEmbeddedskins="false" |
| RecordCountString="Total Record Count: {0}" Width="700px" RecordCountCssClass="" InsertMode="1" InsertInDialogWindow="0" EnableAJAXLoadingTemplate="True" |
| DataActiveField="Active" BorderWidth="1px" ShowFooter="True" GridLines="None" PagerStyleVisible="False" FooterStyle-BackColor="AliceBlue" > |
| <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" Visible="False" /> |
| <ClientSettings AllowDragToGroup="True"></ClientSettings> |
| <MasterTableView CommandItemDisplay="Top" ShowHeader="True" Width="100%" DataKeyNames="MonthlyDate" ShowFooter="true" EditMode="InPlace"> |
| <EditFormSettings> |
| <PopUpSettings ScrollBars="None"></PopUpSettings> |
| </EditFormSettings> |
| <CommandItemTemplate> |
| <asp:LinkButton ID="lnkInsert" runat="server" Visible="false" CommandName="InitInsert" CausesValidation="false"> <img style="border:0px" alt="" src="../images/AddRecord.gif" />Add New Interim Deposit</asp:LinkButton> |
| </CommandItemTemplate> |
| <CommandItemSettings AddNewRecordImageUrl="AddRecord.gif" RefreshImageUrl="Refresh.gif"> |
| </CommandItemSettings> |
| <FooterStyle BackColor="White" ForeColor="Black" Font-Size="12pt" |
| Font-Bold="False" HorizontalAlign="Right" /> |
| </MasterTableView> |
| <HeaderContextMenu EnableEmbeddedSkins="False" EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </HeaderContextMenu> |
| <FilterMenu EnableEmbeddedSkins="False" EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |