i m generating report thorugh reoprt viewer.. i want show my record which date i select but it cant select data from date which are giving it taking system date to display data...
example i select 2013-11-15 it doesnot showing any databut when i chnge my system date to 15 it is showing data...
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style4">
</td>
<td class="style3">
</td>
<td align="right">
Date</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox1" format="yyyy-MM-dd">
</asp:CalendarExtender>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Search"
onclick="Button1_Click1" /></td>
</tr>
<tr>
<td colspan="5">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Kruti Dev 010"
Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="853px"
ondatabinding="Button1_Click">
<LocalReport ReportPath="purchasereport.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetData"
TypeName="emandiDataSetTableAdapters.jdreportpTableAdapter"
DeleteMethod="Delete" InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="Original_No" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="SerialNo" Type="Int32" />
<asp:Parameter Name="DealerName" Type="String" />
<asp:Parameter Name="Dated" Type="DateTime" />
<asp:Parameter Name="CName" Type="String" />
<asp:Parameter Name="VehicleNo" Type="String" />
<asp:Parameter Name="ItemName" Type="String" />
<asp:Parameter Name="Quantity" Type="Decimal" />
<asp:Parameter Name="ItemUnit" Type="String" />
<asp:Parameter Name="ItemRate" Type="Decimal" />
<asp:Parameter Name="ItemCost" Type="Decimal" />
<asp:Parameter Name="TotalAmount" Type="Decimal" />
<asp:Parameter Name="Majduri" Type="Decimal" />
<asp:Parameter Name="Transport" Type="Decimal" />
<asp:Parameter Name="AgentName" Type="String" />
<asp:Parameter Name="Agenty" Type="Decimal" />
<asp:Parameter Name="TotalCharges" Type="Decimal" />
<asp:Parameter Name="NetTotal" Type="Decimal" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="SerialNo" Type="Int32" />
<asp:Parameter Name="DealerName" Type="String" />
<asp:Parameter Name="Dated" Type="DateTime" />
<asp:Parameter Name="CName" Type="String" />
<asp:Parameter Name="VehicleNo" Type="String" />
<asp:Parameter Name="ItemName" Type="String" />
<asp:Parameter Name="Quantity" Type="Decimal" />
<asp:Parameter Name="ItemUnit" Type="String" />
<asp:Parameter Name="ItemRate" Type="Decimal" />
<asp:Parameter Name="ItemCost" Type="Decimal" />
<asp:Parameter Name="TotalAmount" Type="Decimal" />
<asp:Parameter Name="Majduri" Type="Decimal" />
<asp:Parameter Name="Transport" Type="Decimal" />
<asp:Parameter Name="AgentName" Type="String" />
<asp:Parameter Name="Agenty" Type="Decimal" />
<asp:Parameter Name="TotalCharges" Type="Decimal" />
<asp:Parameter Name="NetTotal" Type="Decimal" />
<asp:Parameter Name="Original_No" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
</td>
</tr>
</table>
<div>
</div>
</form>
</body>
protected void Button1_Click1(object sender, EventArgs e)
{
con.Open();
SqlCommand com1 = new SqlCommand("delete from reportp", con);
com1.ExecuteNonQuery();
con.Close();
con.Open();
SqlDataAdapter da = new SqlDataAdapter("insert into jdreportp(SerialNo,Dated,DealerName,VehicleNo,CName,ItemName,Quantity,ItemUnit,ItemRate,ItemCost,TotalAmount,Majduri,Transport,AgentName,Agenty,TotalCharges,NetTotal)select SerialNo,Dated,DealerNameHn,VehicleNo,CName,ItemNameHn,Quantity,UnitHn,ItemRatePrint,ItemCostPrint,TotalAmountPrint,TotalMajduri,Transport,AgentNameHn,Agenty,TotalTexesPrint,NetTotalPrint from purchaseform where dated='" + TextBox1.Text + "'", con);
DataTable dt = new DataTable();
da.Fill(dt);
con.Close();
}
here reportp is temporary table which save all the select data from purchasefrom.