Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2007, 10:40 AM
Authorized User
 
Join Date: Feb 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generating a Crystal Report using a dataset.

Hi,

I've looked over many forums regarding this topic but I haven't been able yet to create a Crystal report from a dataset. However, I have been able to create a report from an XML file.

No error appears as the code is running but when the report is supposed to activate I get the following message:

Logon failed. Details: crdb adoplus: Object reference not set to an instance of an object. Error in File: C\DOCUME~1\MachineName\LOCALS~1\Temp\CrystalReport Pub {02A90148-FBDC-45F1-6JHT-469D6F31CFB6}.rpt: Unable to connect:incorrect log on parameters

I have the folder of this website set to Integrated Windows Authentication.

I have also created a dataset in my project: Dataset1

Here's the code I have:
Code:
protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            myConnection = new SqlConnection("Data Source=I8600-02;Initial Catalog=pubs;Integrated Security=SSPI;");
            SqlCommand myCommand = new SqlCommand("Select * from Stores", myConnection);
            SqlDataAdapter da = new SqlDataAdapter(myCommand);
            DataSet1 ds = new DataSet1();
            //DataTable dt = new DataTable("stores");
            //ds.Tables.Add(dt);

            da.Fill(ds, "Stores");

            oRpt.Load(@"C:\Inetpub\wwwroot\CrystalReportingSite\CrystalReportPub.rpt");

            oRpt.SetDataSource(ds);
            //oRpt.Database.Tables["stores"].SetDataSource(ds);
            //oRpt.SetDataSource(ds.Tables[0]);            
        }

        catch (Exception ex)
        {
            throw new Exception("Internal error:  " + ex.Message);
        }

        CrystalReportViewer1.ReportSource = oRpt;
        CrystalReportViewer1.DataBind();
        CrystalReportViewer1.DisplayToolbar = false;
    }

Can anyone please help me with this?

I appreciate any help provided!

 
Old February 19th, 2007, 06:42 PM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am facing the exact same problem

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 56: da.Fill(ds, "DegInfo");
Line 57:
Line 58: oRpt.SetDataSource(ds);
Line 59:
Line 60:


Source File: c:\inetpub\wwwroot\webapplication5\webform1.aspx.c s Line: 58

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   WebApplication5.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication5\webform1.aspx.c s:58
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()





the setdatasource fuction is doing all the problem

if u have managed to find a solution

or anyother way ..... for crytsal reports to work

kindly plzz do let me knw :(

 
Old February 19th, 2007, 06:45 PM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am facing the exact same problem

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 56: da.Fill(ds, "DegInfo");
Line 57:
Line 58: oRpt.SetDataSource(ds);
Line 59:
Line 60:


Source File: c:\inetpub\wwwroot\webapplication5\webform1.aspx.c s Line: 58

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   WebApplication5.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication5\webform1.aspx.c s:58
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()





the setdatasource fuction is doing all the problem

if u have managed to find a solution

or anyother way ..... for crytsal reports to work

kindly plzz do let me knw :(





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Report Dataset Louisa VB.NET 2002/2003 Basics 0 August 8th, 2006 10:50 AM
Crystal Report, Stored Procedure, Dataset clioz Crystal Reports 0 July 19th, 2006 06:28 PM
Creating a Crystal Report from a runtime dataset vbmazza ASP.NET 1.0 and 1.1 Basics 0 March 17th, 2006 07:40 AM
Generating Crystal Report using Vb.net meniacus1 Crystal Reports 0 January 22nd, 2006 11:09 PM
Crystal Report and Strongly-Typed dataset jaucourt Crystal Reports 1 February 9th, 2004 07:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.