Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select

Grid / Export to ExcelML

Add new recordRefresh   |     
Order IDProduct IDProduct NameUnit PriceQuantityDiscountExtended Price
Page size:
select
 200 items in 20 pages
1024811Queso Cabrales14.00120168.0000
1024842Singaporean Hokkien Fried Mee9.8010098.0000
1024872Mozzarella di Giovanni34.8050174.0000
1024914Tofu18.6090167.4000
1024951Manjimup Dried Apples42.404001696.0000
1025041Jack's New England Clam Chowder7.7010077.0000
1025051Manjimup Dried Apples42.40350.151261.4000
1025065Louisiana Fiery Hot Pepper Sauce16.80150.15214.2000
1025122Gustaf's Knäckebröd16.8060.0595.7600
1025157Ravioli Angelo15.60150.05222.3000

  • This demo shows how you can use the ExcelML export to format the rows, set a number format, set the page options (orientation, margins, alignment) and how to freeze a pane.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" Inherits="Telerik.GridExamplesVBNET.GeneralFeatures.ExcelMLExport.DefaultVB"
        CodeFile="DefaultVB.aspx.vb" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <telerik:HeadTag runat="server" ID="Headtag2"></telerik:HeadTag>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <telerik:Header runat="server" ID="Header1" NavigationLanguage="VB"></telerik:Header>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <!-- content start -->

        <script type="text/javascript">
            function requestStart(sender, args)
            {
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0)
                {
                    args.set_enableAjax(false);
                }
            }
        </script>

        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
            ClientEvents-OnRequestStart="requestStart">
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None"
                AllowPaging="true" OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated"
                OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated">
                <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                    <Excel Format="ExcelML" />
                </ExportSettings>
                <MasterTableView DataKeyNames="OrderID,ProductID" DataSourceID="SqlDataSource1" CommandItemDisplay="Top">
                    <CommandItemSettings ShowExportToExcelButton="true" />
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT TOP(200) * FROM [Order Details Extended]"></asp:SqlDataSource>
        <!-- content end -->
        <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451