Print Page | Close Window

Unable to get the crystal reports

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=12060
Printed Date: 05 May 2024 at 3:20am


Topic: Unable to get the crystal reports
Posted By: rkittu2k7
Subject: Unable to get the crystal reports
Date 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



Replies:
Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rkittu2k7
Date 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();
        }

    }
}


Posted By: hilfy
Date Posted: 18 Jan 2011 at 3:45am

Which line do you get the error on?

-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rkittu2k7
Date 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 


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rkittu2k7
Date 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.


Posted By: hilfy
Date Posted: 20 Jan 2011 at 3:38am
What type of class is WS_UAA.ReturnDR?   Is it a DataSet?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: hilfy
Date 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


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rkittu2k7
Date 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


Posted By: rkittu2k7
Date Posted: 23 Jan 2011 at 7:20pm
yes it is a dataset


Posted By: hilfy
Date Posted: 24 Jan 2011 at 3:13am
The syntax you're using to load data into the dataset is not what I'm used to dealing with.  I'm fairly sure that the issue you're running into has to do with how your dataset is set up, whether there is a specific table in the dataset that your report is connected to, and whether that table has data in it.  Beyond that, I'm not sure where to go to tell you how to fix it.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rkittu2k7
Date Posted: 24 Jan 2011 at 5:42pm
Iam using a dataset which contains a specific table where my report is connected and the table also has data in it, but iam unable to find what the problem is?



Print Page | Close Window