本文介绍了我在两个日期之间创建一个水晶报告...我没有得到正确的O / P.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好先生。
我想在水晶报告中的两个日期之间搜索...但我没有得到正确的输出..我的代码在下面... .plz帮助我.....
Hello sir.
I want to search between Two dates in crystal report...but im not getting Proper output..my code is below....plz help me.....
protected void Page_Load(object sender, EventArgs e)
{
DataSet1 ds = new DataSet1();
DataSet1TableAdapters.job_tableTableAdapter da = new DataSet1TableAdapters.job_tableTableAdapter();
da.Fill(ds.job_table);
CrystalReportSource1.ReportDocument.SetDataSource(ds);
}
protected void CrystalReportViewer1_Init(object sender, EventArgs e)
{
}
protected void RadButton1_Click(object sender, EventArgs e)
{
DataSet1 ds = new DataSet1();
DataSet1TableAdapters.job_tableTableAdapter da = new DataSet1TableAdapters.job_tableTableAdapter();
da.Fill(ds.job_table);
CrystalReportSource1.ReportDocument.SetDataSource(ds);
if (RadDatePicker1.SelectedDate.HasValue && RadDatePicker2.SelectedDate.HasValue)
{
CrystalReportViewer1.SelectionFormula = "{job_table.date}>=#" + RadDatePicker1.SelectedDate.Value.ToShortDateString() + "# and {job_table.date}<=#" + RadDatePicker2.SelectedDate.Value.AddDays(0).ToShortDateString() + "#";
}
else if (RadDatePicker1.SelectedDate.HasValue)
{
CrystalReportViewer1.SelectionFormula = "{job_table.date}>=#" + RadDatePicker1.SelectedDate.Value.ToShortDateString() + "# and {job_table.date}<=#" + RadDatePicker1.SelectedDate.Value.AddDays(0).ToShortDateString() + "#";
//CrystalReportViewer1.SelectionFormula = "{Bill_gen.DOO}>=#" + RadDatePicker1.SelectedDate.Value.ToShortDateString() + "#";
}
else
{
}
}
}
推荐答案
这篇关于我在两个日期之间创建一个水晶报告...我没有得到正确的O / P.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!