I am using this code to search records from
when i goto this page i am getting this error
The maximum report processing jobs limit configured by your system administrator has been reached
i couldnt find this path HKEY_LOCAL_MACHINE\SOFTWARE\CRYSTAL DECISIONS\10.0\REPORT APPLICATION SERVER\SERVER\PrintJobLimit to make it -1 for unlimited print job
protected void Button2_Click(object sender, EventArgs e)
{
if (TextBox2.Text == "" && TextBox3.Text == "" && TextBox4.Text == "")
{
DateTime date = Convert.ToDateTime(TextBox1.Text);
SqlCommand cmd = new SqlCommand("SELECT * FROM Transactions where report_type = @report_type and dateadd(dd, datediff(dd,0, [R_date]), 0) = @R_date ");
cmd.Connection = con;
cmd.Parameters.Add("@report_type", SqlDbType.NVarChar).Value = DropDownList1.SelectedValue;
cmd.Parameters.Add("@R_date", SqlDbType.DateTime).Value = date.Date;
SqlDataAdapter da = new SqlDataAdapter(cmd);
dt.Clear();
da.Fill(dt);
}
else if (TextBox2.Text != "")
{
con.Open();
string s = ("Select * from Transactions where idcount like '%" + TextBox2.Text + "%' or Patient_ID_NO like '%" + TextBox2.Text + "%'or Patient_no like '%" + TextBox2.Text + "%'");
SqlCommand cmd = new SqlCommand(s, con);
cmd.Parameters.Add("@idcount", SqlDbType.Decimal).Value = TextBox2.Text;
cmd.Parameters.Add("@Patient_ID_NO", SqlDbType.Decimal).Value = TextBox2.Text;
cmd.Parameters.Add("@Patient_no", SqlDbType.Int).Value = TextBox2.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
dt.Clear();
da.Fill(dt);
TextBox2.Text = "";
}
else if (TextBox3.Text != "")
{
SqlCommand cmd = new SqlCommand("SELECT * FROM Transactions where report_type = @report_type ");
cmd.Connection = con;
cmd.Parameters.Add("@report_type", SqlDbType.NVarChar).Value = DropDownList1.SelectedValue;
SqlDataAdapter da = new SqlDataAdapter(cmd);
dt.Clear();
da.Fill(dt);
TextBox3.Text = "";
}
else
{
DateTime date = Convert.ToDateTime(TextBox4.Text);
SqlCommand cmd = new SqlCommand("SELECT * FROM Transactions where dateadd(dd, datediff(dd,0, [R_date]), 0) = @R_date ");
cmd.Connection = con;
//cmd.Parameters.Add("@report_type", SqlDbType.NVarChar).Value = DropDownList1.SelectedValue;
cmd.Parameters.Add("@R_date", SqlDbType.DateTime).Value = date.Date;
SqlDataAdapter da = new SqlDataAdapter(cmd);
dt.Clear();
da.Fill(dt);
TextBox4.Text = "";
}
if (dt.Rows.Count > 0)
{
ReportDocument MedicalReport = new ReportDocument();
MedicalReport.Load(Server.MapPath("~/CrystalReport2.rpt"));
MedicalReport.SetDataSource(dt);
MedicalReport.SetDatabaseLogon("sa", "123", @"ROOM-8", "Mreport");
CrystalReportViewer1.ReportSource = MedicalReport;
CrystalReportViewer1.DataBind();
MedicalReport.Dispose();
}
con.Close();
}