Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please Help,

I am creating a Simple Crystal report that views outstanding logs for our call centre.

I have a stored procedure that retrieves all the Info I need.
Here is where it gets interesting. The Report retrives all the relevant data and shows me page One. When I try to view the second page I get the following "The report you requested requires further information" .

It then requests Logon Credentials and when I attempt to go to the last Page of the Report I get the following Error "Unable to connect: incorrect log on parameters."

Using Crystal Viewer I can view my Report; it has about 50 or so pages when I test with 10 days.

I have googled but none of the suggested solutions seem to work.

I use the following: SQL Server 2005 Express Edition; VS2008; Crystal reports Version 10.5.

Heres the code I use.
My Connection String looks like this:
I use windows authentication to logon.
Thanks in advance.
C#
Data Source=ServerName\SQLEXPRESS;Initial Catalog=DBNAME;Integrated Security=True;
try
{
  CrystalReport1 myRpt = new CrystalReport1();
  CrystalReportViewer1.DisplayGroupTree = false;
  CrystalReportViewer1.DisplayToolbar = true;
  string myConstr = ConfigurationManager.AppSettings["ConnectionString"];
  SqlConnection myConnection = new SqlConnection(myConstr);
  SqlDataAdapter myAdapter = new SqlDataAdapter();
  DataSet1 myDataSet = new DataSet1();
  SqlCommand MyCommand = myConnection.CreateCommand();
  MyCommand.CommandText = "procName";
  MyCommand.CommandType = CommandType.StoredProcedure;
  myAdapter.SelectCommand = MyCommand;
  myAdapter.SelectCommand.Parameters.Add(new SqlParameter("@myPara",Convert.ToInt32(txtDays.Text)));
  myAdapter.Fill(myDataSet, "procName");
  CrystalReportViewer1.ReportSource = myRpt;
  CrystalReportViewer1.DataBind();
}
catch (Exception ex)
{
  string strEX;
  Page.ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('Enter Day Criteria Please!!!');", true);               
}
Posted
Updated 28-Oct-10 22:47pm
v3
Comments
Dalek Dave 29-Oct-10 4:48am    
Edited for Grammar and Readability.

1 solution

You need to apply login for Crystal report at run time like you have applied for SQL server. That's all, following article will help you.

Troubleshooting Database Login Errors using Crystal Reports with .NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900