kumartyr

kumartyr

  • NA
  • 55
  • 28.1k

Crystal Report error in client machine

Mar 13 2014 4:47 AM
I developed a desktop application in C# 4.0 with Oracle 11g & used Crystal report for VS 2010
it executing & running fine in development 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 ..getting a exception
 
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))
{
CON.Close();
}
CON.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();
OADAP1.Fill(DTB);
}
}
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";
RDT.Load(reportpath);
ConnectionInfo connectioninfo = new ConnectionInfo();
connectioninfo.DatabaseName = "ORCL";
connectioninfo.UserID = "itapps";
connectioninfo.Password = "it123";
Logindetailforreport(connectioninfo,RDT);
VisitorIDCrystalReportViewer.ReportSource = RDT;
RDT.SetDataSource(DTB);
}
And for exception i am not able to get any idea..