i have code on click button like this...
con = clsSql.getconnection;
try
{
lblExcept.Text = null;
if (Convert.ToInt32(con.State) < 1)
{
con.Open();
}
frmDt = txtFromDate.Text.Trim();
endDt = txtEndDate.Text.Trim();
dd = frmDt.Substring(0, 2);
mm = frmDt.Substring(3, 2);
yy = frmDt.Substring(6, 4);
frmDt = mm + "/" + dd + "/" + yy;
dd = endDt.Substring(0, 2);
mm = endDt.Substring(3, 2);
yy = endDt.Substring(6, 4);
endDt = mm + "/" + dd + "/" + yy;
lblExcept.Text = null;
lblTab.Text = null;
query = @"select did,Sno,convert(varchar(11),Date,106) as Date,REGION,CLIENTSNAME,ShortAddress,CATEGORY,
Local_Corporate_Client,PERSON,MOB_PH_No,EMAIL,AGENCY,HOTCLINT,
TARGET,Visitby,Remarks from DSR where Date between '" + frmDt + @"' and '" + endDt + "' ";
cmd = new SqlCommand(query, con);
dr = cmd.ExecuteReader();
lblTab.Text = null;
if (dr.HasRows)
{
lblTab.Text += @"<table id='data-grid' class='alternate' border='0' cellpadding='0' cellspacing='0'>";
lblTab.Text += @"<tr>";
lblTab.Text += @"<th width='50' align='left'>SlNo</th>";
lblTab.Text += @"<th width='110' align='left'>Date</th>";
lblTab.Text += @"<th width='110' align='left'>REGION</th>";
lblTab.Text += @"<th width='110' align='left'>CLIENTSNAME</th>";
lblTab.Text += @"<th width='110' align='left'>ShortAddress</th>";
lblTab.Text += @"<th width='110' align='left'>CATEGORY</th>";
lblTab.Text += @"<th width='110' align='left'>Local_Corporate_Client</th>";
lblTab.Text += @"<th width='110' align='left'>PERSON</th>";
lblTab.Text += @"<th width='50' align='left'>MOB_PH_No</th>";
lblTab.Text += @"<th width='50' align='left'>EMAIL</th>";
lblTab.Text += @"<th width='50' align='left'>AGENCY</th>";
lblTab.Text += @"<th width='50' align='left'>HOTCLINT</th>";
lblTab.Text += @"<th width='50' align='left'>TARGET</th>";
lblTab.Text += @"<th width='50' align='left'>Visitby</th>";
lblTab.Text += @"<th width='50' align='left'>Remarks</th>";
lblTab.Text += @"</tr>";
NetAmt = 0;
while (dr.Read())
{
i += 1;
lblTab.Text += @"<tr>";
lblTab.Text += @"<td valign='top'>" + i + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["Date"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["REGION"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["CLIENTSNAME"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["ShortAddress"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["CATEGORY"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["Local_Corporate_Client"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["PERSON"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["MOB_PH_No"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["EMAIL"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["AGENCY"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["HOTCLINT"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["TARGET"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["Visitby"]) + "</td>";
lblTab.Text += @"<td valign='top'>" + Convert.ToString(dr["Remarks"]) + "</td>";
lblTab.Text += @"</tr>";
}
lblTab.Text += @"</table>";
}
else
{
lblTab.Text = "Data Not Found Please Check Date...";
}
if (dr.IsClosed == false)
{
dr.Close();
}
}
catch (Exception ex)
{
lblExcept.Text = ex.Message.ToString();
}
finally
{
if (Convert.ToInt32(con.State) >= 1)
{
con.Close();
}
}
i want export result in pdf...