Asim

Asim

  • NA
  • 1
  • 0

problem with crystal report pass dynamic server name

Jul 3 2009 2:16 PM

Hi,
I am facing a problem with crystal report.  I have developed a .net application with 3.5 it has some crystal reports all reports working fine in my computer but whenever i have load my setup to client machine the report can't display the report its break on server name and password ... So i need to pick server name at runtime from clients machine's config file
or there is any way to pass a method return dataTable in crystal report like this..
using
System.Data;
using
System.Data.SqlClient;
using
Microsoft.Practices.EnterpriseLibrary.Data;
using
System.Data.Common;
namespace
HM.Reports
{

public class ExpensesReportData
{
public string AccountName { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public DataTable GetExpensesData(DateTime StartDate, DateTime EndDate)
{
Database db = DatabaseFactory.CreateDatabase();
DbCommand dbcommand = db.GetStoredProcCommand("usp_GetExpensesReport");
db.AddInParameter(dbcommand,
"@StartDate", DbType.DateTime, StartDate);
db.AddInParameter(dbcommand,
"@EndDate", DbType.DateTime, EndDate);
DataSet ds = db.ExecuteDataSet(dbcommand);
return ds.Tables[0];
}
}
this method is working in fine my another report and but not in second one....
Thanx in advance any help will higly apriciated....