C# .NET - Create crystal Reports through Two Data Bases having seprate ConString

Asked By dipak sinha on 24-Jan-12 02:24 AM
Hello Sir/Madam,

     I am trying to create crystal report through Two Data Bases that having the seperate connection String and it is used in a single project.
       
          through single  data base it can be  done easily but through Two different database how i can create crystal report.
  
      Please suggest me.
smr replied to dipak sinha on 24-Jan-12 03:20 AM
hi

If you need to get data from different database, better use PUSH method to bind the report with the database instead PULL method. Create a dataset(if you have multiple tables) load all the data required (even from different database) then bind to the report.

   If you need help to use PUSH method, you can refer http://forums.asp.net/t/1467325.aspx

kalpana aparnathi replied to dipak sinha on 24-Jan-12 03:57 AM
hi,

Try this code:

private void Command1_Click()
{
  var _with1 = CrystalReport1;
 
  //* works with SQL server *
  _with1.Connect = "dsn=myLocalSQLDB;uid=myID;pwd=myPassword";
  //works
  //.ReportFileName = "C:\Report_SqlSers.rpt"         'works
 
  //* works with MSAccess *
  _with1.Connect = "dsn=myLocalAccessDB";
  //works
  //.ReportFileName = "C:\Report_MSAccess.rpt"        'works
 
  ///* Both */
  _with1.ReportFileName = "C:\\Report_both.rpt";
  //with runtime error, due to re-assign value as the
  //parameter to the connection, I believe?
 
  _with1.WindowHeight = 600;
  _with1.WindowWidth = 800;
  _with1.Action = 1;
 
}
dipak sinha replied to smr on 24-Jan-12 05:29 AM
hi,

   The link u provide is not opening..........