How to export database data to PDF file in ASP.NET.

In this post I am explain how to export database data to PDF file in ASP.Net. Here i am writing this article to explain how to export database data to PDF file in ASP.NET


Export Database Data to PDF in ASP.NET

Sl No.CountryStateCity
1IndiaAssamAbhayapuri
2IndiaAssamBadarpur
3IndiaWest BengalMalda
4IndiaWest BengalMedinipur
5IndiaWest BengalMejia
6IndiaWest BengalMemari
7IndiaWest BengalMidnapore
8IndiaWest BengalMidnapur
9United KingdomAberdeen CityAberdeen
10United KingdomAberdeen CityDyce
11United KingdomAberdeen CityMilltimber
12United KingdomAberdeen CityOld Aberdeen
13United KingdomAberdeen CityPeterculter
14United KingdomAberdeen CityStoneywood
15United KingdomAberdeenshireMacduff
16United KingdomAberdeenshireMintlaw
17United KingdomAberdeenshireNewtonhill
18United KingdomAberdeenshireOldmeldrum
19United KingdomAberdeenshirePeterhead
20USACaliforniaAcampo
21USACaliforniaActon
22USACaliforniaAdelanto
23USACaliforniaAdin
24USACaliforniaAgoura Hills
 

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="ASpExportPDF.SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
    <meta charset="utf-8" />
    <title><%: Page.Title %> - My ASP.NET Application</title>
    <link href="~/Content/Site.css" rel="stylesheet" /> 
    <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <asp:PlaceHolder runat="server">        
        <script src="<%: ResolveUrl("~/Scripts/modernizr-2.5.3.js") %>"></script>
    </asp:PlaceHolder>
    <meta name="viewport" content="width=device-width" />
    <asp:ContentPlaceHolder runat="server" ID="HeadContent" />
</head>
<body>
    <form runat="server">
    <asp:ScriptManager runat="server">
        <Scripts>
            <asp:ScriptReference Name="jquery" />
            <asp:ScriptReference Name="jquery.ui.combined" />
        </Scripts>
    </asp:ScriptManager>
    <header>
        <div class="content-wrapper">
            <div class="float-left">
                <p class="site-title"><a runat="server" href="~/">your logo here</a></p>
            </div>
            <div class="float-right">
                <section id="login">
                    <asp:LoginView runat="server" ViewStateMode="Disabled">
                        <AnonymousTemplate>
                            <ul>
                                <li><a id="registerLink" runat="server" href="~/Account/Register.aspx">Register</a></li>
                                <li><a id="loginLink" runat="server" href="~/Account/Login.aspx">Log in</a></li>
                            </ul>
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            <p>
                                Hello, <a runat="server" class="username" href="~/Account/Manage.aspx" title="Manage your account">
                                    <asp:LoginName runat="server" CssClass="username" />
                                </a>!
                                <asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/" />
                            </p>
                        </LoggedInTemplate>
                    </asp:LoginView>
                </section>
                <nav>
                    <ul id="menu">
                        <li><a runat="server" href="~/">Home</a></li>
                        <li><a runat="server" href="~/About.aspx">About</a></li>
                        <li><a runat="server" href="~/Contact.aspx">Contact</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <div id="body">
        <asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
        <section class="content-wrapper main-content clear-fix">
            <asp:ContentPlaceHolder runat="server" ID="MainContent" />
        </section>
    </div>
    <footer>
        <div class="content-wrapper">
            <div class="float-left">
                <p>&copy; <%: DateTime.Now.Year %> - My ASP.NET Application</p>
            </div>
        </div>
    </footer>
    </form>
</body>
</html>
Posted By : Sourav Mondal