How to export HTML Gridview to PDF with Grid header HTML Data repeating on every page with paging (1 of N)
<form id="form1" runat="server">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager>
<div>
<fieldset>
<legend><b>Reports</b> <asp:Button ID="BtnLogout"
runat="server" Text="Logout" CssClass="textnow" OnClick="BtnLogout_Click" />
</legend>
<label for="field45">
<br />
<br />
<br />
<br />
</label>
<label for="field015">
<span>Filter </span>
<asp:DropDownList ID="DdlFilter" runat="server" Width="270px" CssClass="textbox" AutoPostBack="True" OnSelectedIndexChanged="DdlFilter_SelectedIndexChanged">
<asp:ListItem Value="0">----- Select Filter -----</asp:ListItem>
<asp:ListItem Value="1">Alarms</asp:ListItem>
<asp:ListItem Value="2">Audit Trail</asp:ListItem>
<asp:ListItem Value="3">Trend</asp:ListItem>
</asp:DropDownList>
</label>
<br id="posttopspace" runat="server" visible="false" />
<label id="lblpostfilt" for="field015" runat="server" visible="false">
<span>Post Filter </span>
<asp:DropDownList ID="DdlPostFilter" runat="server" Width="270px" CssClass="textbox">
<asp:ListItem Value="0">----- Select Post Filter -----</asp:ListItem>
<asp:ListItem Value="1">All</asp:ListItem>
<asp:ListItem Value="2">Actioned Alarm</asp:ListItem>
<asp:ListItem Value="3">Alarm Requiring Action</asp:ListItem>
</asp:DropDownList>
</label>
<br id="ahutopspace" runat="server" visible="false" />
<label id="lblAHU" for="field019" runat="server" visible="false">
<span>AHU No.</span>
<asp:DropDownList ID="DdlAHU" runat="server" Width="270px" CssClass="textbox">
</asp:DropDownList>
</label>
<br />
<label for="field017">
<span>Date Filter </span>
<asp:DropDownList ID="DDldate" runat="server" Width="270px" CssClass="textbox" AutoPostBack="True" OnSelectedIndexChanged="DDldate_SelectedIndexChanged">
<asp:ListItem Value="0">----- Select Date -----</asp:ListItem>
<asp:ListItem Value="1">All</asp:ListItem>
<asp:ListItem Value="2">Last 24 Hours</asp:ListItem>
<asp:ListItem Value="3">Custom</asp:ListItem>
</asp:DropDownList>
</label>
<br />
<label id="lbldate" for="field15" runat="server" visible="false">
<span>Select Date Range </span>
<asp:TextBox ID="txtFrom" runat="server" Width="250px"></asp:TextBox>
<img src="calender.png" alt="From Date" id="frmimgPopup" />
<cc1:CalendarExtender ID="frmcal" PopupButtonID="frmimgPopup" runat="server" TargetControlID="txtFrom"
Format=" yyyy-MM-dd">
</cc1:CalendarExtender>
<asp:TextBox ID="txtTo" runat="server" Width="250px"></asp:TextBox>
<img src="calender.png" alt="To Date" id="toimgPopup" />
<cc1:CalendarExtender ID="tocal" PopupButtonID="toimgPopup" runat="server" TargetControlID="txtTo"
Format="yyyy-MM-dd">
</cc1:CalendarExtender>
</label>
<label for="field45">
<br />
<br />
</label>
<label for="field5">
<asp:Button ID="BtnSearch" runat="server" CssClass="textnow" Text="Submit" OnClick="BtnSearch_Click" />
<asp:Button ID="ButnPrint" runat="server" CssClass="textnow" Text="Print" OnClick="ButnPrint_Click" />
</label>
<div id="dvHtml" runat="server" style="margin: 0 0 0 0;">
<table style="text-align: left; width: 100%; font-size: 11px; background-color: white" border="0" cellpadding="6" cellspacing="0">
<tr>
<td>Report Name :
<asp:Label ID="lblReport" runat="server" Text=""></asp:Label></td>
<td>Report Generated At :
<asp:Label ID="lblReptAt" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td>Report Generated By :
<asp:Label ID="lblReptBy" runat="server" Text=""></asp:Label></td>
<td>Machine IP :
<asp:Label ID="lblReptIP" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td colspan="2">
<asp:GridView ID="gvCustomers" runat="server" AutoGenerateColumns="false"
DataKeyNames="theIndex" Width="100%" Font-Size="9">
<Columns>
<asp:BoundField DataField="originalAlarmTime" HeaderText="OS Time">
<ItemStyle Width="20px" Height="25px" />
</asp:BoundField>
<asp:BoundField DataField="ackedAlarm" HeaderText="Acknowledged">
<ItemStyle Width="20px" Height="25px" />
</asp:BoundField>
<asp:BoundField DataField="theDesc" HeaderText="Description">
<ItemStyle Width="450px" />
</asp:BoundField>
<asp:BoundField DataField="PointLabel" HeaderText="Item Label">
<ItemStyle Width="50" />
</asp:BoundField>
<asp:BoundField DataField="ackedTime" HeaderText="Action Time">
<ItemStyle Width="150px" />
</asp:BoundField>
<asp:BoundField DataField="ackedUser" HeaderText="Action User">
<ItemStyle Width="100px" />
</asp:BoundField>
<asp:BoundField DataField="userText" HeaderText="Action User Text">
<ItemStyle Width="350px" />
</asp:BoundField>
</Columns>
<HeaderStyle Font-Bold="True" Font-Names="Trebuchet MS"
Font-Size="10" />
</asp:GridView>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
</form>