Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: Unable to get the crystal reports Post Reply Post New Topic
Page  of 2 Next >>
Author Message
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Topic: Unable to get the crystal reports
    Posted: 13 Jan 2011 at 12:42am
I have developed a web application in visual studio 2008 which contains some reports iam getting the below error when i run my crystal reports kindly provide me a solution
Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\RAMAKR~1.NIT\LOCALS~1\Temp\vehtimelag {0375CEB7-60CA-4FF2-8E8F} kindly help me it is very urgent

Thanks in advance
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Jan 2011 at 8:58am
Please post the code you're using to display the report.  Also, are you connecting to an in-memory DataSet or to a database?  If your report connects to the database, is the database client installed on your webserver?  Can you connect to the database from your webserver?
 
-Dell
IP IP Logged
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Posted: 16 Jan 2011 at 10:09pm
iam connecting to an in-memory dataset here is the code for my report

namespace SCM
{
    public partial class timelag : System.Web.UI.Page
    {
        WS_UAA.AVLS_WS_UAASoapClient w = new WS_UAA.AVLS_WS_UAASoapClient();
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void crvvehicletimelag_Init(object sender, EventArgs e)
        {
           
        }

        protected void timelag_Init(object sender, EventArgs e)
        {
            WS_UAA.ReturnDR ret = default(WS_UAA.ReturnDR);

            ret = w.Selectt("SELECT ST_Vehicle_Reg_No,ST_Route_ID,convert(varchar, ST_Sch_Time, 100) as ST_Sch_Time,convert(varchar, ST_Actual_Start_Time, 100) as ST_Actual_Start_Time,ST_DATE from B_Vehicle_TimeLag where ST_DATE='" + Session["SD"] + "'", Session["Username"].ToString());

            vehtimelag rpt = new vehtimelag();
            //rpt.Load(Server.MapPath("vehtimelag.rpt"));

            rpt.SetDataSource(ret.Trigger_Return_Table);
            //rpt.SetDatabaseLogon("sa", "sa123$");




            //ReportObject crReportObject = default(ReportObject);
            TextObject crTextObject = default(TextObject);
            foreach (ReportObject crReportObject in rpt.Section1.ReportObjects)
            {
                if (crReportObject.Kind == ReportObjectKind.TextObject)
                {
                    crTextObject = (TextObject)crReportObject;
                    switch (crReportObject.Name)
                    {

                        case "tbvehtimelagrptdate":
                            crTextObject.Text = Convert.ToDateTime(Session["SD"]).ToString("dd-MMM-yyyy");
                            break;
                    }
                }
            }
            crvvehicletimelag.ReportSource = rpt;
            crvvehicletimelag.DataBind();
        }

    }
}
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jan 2011 at 3:45am

Which line do you get the error on?

-Dell
IP IP Logged
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Posted: 18 Jan 2011 at 6:12pm
Iam not getting error in any line but after running the code me report is not getting displayed aim getting the following error
Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\RAMAKR~1.NIT\LOCALS~1\Temp\vehtimelag {0375CEB7-60CA-4FF2-8E8F}
kindly help me it is very urgent 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 19 Jan 2011 at 3:28am
You need to run this through the debugger, step by step and determine which line of code is causing the error.  That's the only way I know of to diagnose the issue.
 
-Dell
IP IP Logged
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Posted: 19 Jan 2011 at 10:24pm
when i debug the code every line executes correctly but the report opens with the above error iam unable to find where the error is.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 20 Jan 2011 at 3:38am
What type of class is WS_UAA.ReturnDR?   Is it a DataSet?
 
-Dell
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 20 Jan 2011 at 9:27am
Another thing that I missed in your code - try changing this line:
 
rpt.SetDataSource(ret.Trigger_Return_Table);

to this:
 
rpt.SetDataSource(ret);
 
-Dell


Edited by hilfy - 20 Jan 2011 at 9:28am
IP IP Logged
rkittu2k7
Newbie
Newbie


Joined: 05 May 2009
Location: India
Online Status: Offline
Posts: 15
Quote rkittu2k7 Replybullet Posted: 23 Jan 2011 at 7:17pm
I changed this line
 rpt.SetDataSource(ret.Trigger_Return_Table);

to
 
rpt.SetDataSource(ret); but i got an error the data source object is invaild
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.012 seconds.