Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more: , +
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


show me the simple way please .. to search and to print


C#
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using System.IO;
using System.Text;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Web;
using CrystalDecisions.Shared;
using CrystalDecisions;
using CrystalDecisions.ReportAppServer.ClientDoc;

public partial class sampl : System.Web.UI.Page
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ToString());
    SqlDataAdapter da = null;
    DataTable dt = new DataTable();
    DataTable dt1 = new DataTable();
    protected void Page_Load(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 != "")
        {
            
            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);
       
        }
        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);

        }
        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("@R_date", SqlDbType.DateTime).Value = date.Date;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
          
            dt.Clear();
            da.Fill(dt);

            
            

        }
        if (dt.Rows.Count > 0)
        {

            ReportDocument MedicalReport = new ReportDocument();
            MedicalReport.Load(Server.MapPath("~/CrystalReport2.rpt"));
            MedicalReport.SetDataSource(dt);
            MedicalReport.SetDatabaseLogon("sa", "123456789", @"TRAINING-ROOM-8", "newMreport");
            CrystalReportViewer1.ReportSource = MedicalReport;
            CrystalReportViewer1.DataBind();
          


        }
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();
          
 
       }
 
       con.Close();
   
   }
Posted
Updated 1-May-18 0:43am
Comments
Joezer BH 13-Feb-13 7:49am    
Did you try editing the registry OR did you try to find this path in a regular window explorer?

Hi,

you can edit the page limits thorugh regedit,type regedit in run cmd.follow below steps :

HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 11.5\Report Application Server\InprocServer\PrintJobLimit

it ll solve your problem.
 
Share this answer
 
v2
Comments
$ultaNn 16-Feb-13 1:01am    
I try to find the path to edit the registry key , i find this path and edited PrintJobLimit to -1 from 75 but still after some prints its giving me this error ,.,.

HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer\PrintJobLimit
nehas1jan 16-Feb-13 2:32am    
youc an make it -1 it ll print infinite .
$ultaNn 16-Feb-13 2:40am    
i Did make it -1 it work fine for some times then again it is showing me this error,.,.
nehas1jan 16-Feb-13 2:43am    
you can fix it according to daily print jobs...
$ultaNn 16-Feb-13 2:44am    
how?
"HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer"


Set it to any definite number (possibly 500– 1000)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900