In client machine getting Crystal Report error

Posted by Kumartyr under C# on 3/13/2014 | Points: 10 | Views : 1053 | Status : [Member] | Replies : 1
I developed a desktop application in C# 4.0 with Oracle 11g & used Crystal report for VS 2010

it executing & running fine in developement machine & i created a setup file

In client system i installed oracle client and setup file of my application

able to use the application well until i generate any crystal report

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at Visitor_Management_System.VisitorIDReportWindow.VisitorIDReportWindow_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

2nd even if i click continue its asking me server username & password

when searched in net, there are ideas to declare the name & password in coding so i modified coding for CrystalReport's Form Load_event like below but no use
private void VisitorIDReportWindow_Load(object sender, EventArgs e)
if (this.CON.State.Equals(System.Data.ConnectionState.Open))
DataTable DTB;
string query1 = "Select * from VMS_VISITOR where PASSNUMBER ='" + VisitorCreationWindow.PNBR + "'";
using (OLCMND1 = new OracleCommand(query1, CON))
using (OADAP1 = new OracleDataAdapter(OLCMND1))
DTB = new DataTable();
RDT = new ReportDocument();
string reportpath = System.Windows.Forms.Application.StartupPath.Substring(0,System.Windows.Forms.Application.StartupPath.Substring(0,System.Windows.Forms.Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
reportpath += @"\VisitorIDReport.rpt"; //string reportpath = "D:\\Visitor Management System\\Visitor Management System\\VisitorIDReport.rpt";
ConnectionInfo connectioninfo = new ConnectionInfo();
connectioninfo.DatabaseName = "ORCL";
connectioninfo.UserID = "itapps";
connectioninfo.Password = "it123";
VisitorIDCrystalReportViewer.ReportSource = RDT;
And for exception i am not able to get any idea..


Posted by: Antonydurai on: 4/3/2014 [Member] Starter | Points: 25



Did you prepare the setup file with prerequisites components Crystal report.

Kumartyr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response