Crystal Reports 'Command' SetDataSource
-
I wrote my own command in Crystal Reports 9, I want to set the DataSource at runtime. StaffHoursReport staffHoursReport = new StaffHoursReport(); foreach( Table t in staffHoursReport.Database.Tables ) { t.SetDataSource( Db.DataSource ); } Where Db.DataSource is a static string. It works for all the tables in my Report but not for the Command I made. I also tried t.Location = Db.DataSource; but this works for all the tables but throws an exception on any Commands. The SetDataSource does not throw any exceptions but it prompts for the database path when the report is being created for display. And then it says log in failed if i type in the path to the database. The only way this report works is if I have the database in the path specified in the report designer. But this is no good, it will be on different machines all the time. Please help, thanks alot.