WordsProcessing - Generate Documents


Demo Configurator

Exported file type
DOCX
Export settings
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

Telerik RadWordsProcessing provides easy to use API which allows code-only generation of documents. The current example demonstrates how you can generate a document from scratch and export it to one of the supported formats - DOCX, RTF, HTML and TXT.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="Telerik.WordsProcessing.GenerateDocuments.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<!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">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-custom">
        <div class="image">
            <asp:Image ImageUrl="./Images/EmailTemplate.png" CssClass="documentImage" ID="EmailTemplateImage" runat="server" />
            <br />
            <telerik:RadButton RenderMode="Lightweight" Text="Download" ID="Download" CssClass="downloadButton" OnClick="Download_Click" runat="server" />
        </div>
    </div>
    <qsf:ConfiguratorPanel runat="server" ID="ConfiguratorPanel1" Title="Demo Configurator">
        <Views>
            <qsf:View>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Narrow">
                    <fieldset>
                        <legend>Exported file type</legend>
                    </fieldset>
                    <qsf:DropDownList runat="server" ID="ExtensionsDropDownList" Size="Medium">
                        <Items>
                            <telerik:DropDownListItem Value=".docx" Text="DOCX" />
                            <telerik:DropDownListItem Value=".rtf" Text="RTF" />
                            <telerik:DropDownListItem Value=".html" Text="HTML" />
                            <telerik:DropDownListItem Value=".txt" Text="TXT" />
                        </Items>
                    </qsf:DropDownList>
                </qsf:ConfiguratorColumn>
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn2" runat="server" Size="Narrow">
                    <fieldset>
                        <legend>Export settings</legend>
                    </fieldset>
                    <span class="checkbox">
                        <asp:CheckBox Text="Include Header" CssClass="checkBox" Checked="true" ID="IncludeHeader" runat="server" /></span>
                    <span class="checkbox">
                        <asp:CheckBox Text="Include Footer" CssClass="checkBox" Checked="true" ID="IncludeFooter" runat="server" /></span>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </qsf:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?