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!