Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralCrystal Reports 'Command' SetDataSource Pin
krisp7-Jul-03 1:49
krisp7-Jul-03 1:49 
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.
GeneralArrays Pin
_cancer_7-Jul-03 1:21
_cancer_7-Jul-03 1:21 
GeneralRe: Arrays Pin
perlmunger7-Jul-03 11:58
perlmunger7-Jul-03 11:58 
GeneralRe: Arrays Pin
PeterMoon29-Jan-08 17:53
PeterMoon29-Jan-08 17:53 
GeneralC# COM+ Client/Server Pin
SpudgunDoogal7-Jul-03 1:05
SpudgunDoogal7-Jul-03 1:05 
GeneralRe: C# COM+ Client/Server Pin
Daniel Turini7-Jul-03 1:21
Daniel Turini7-Jul-03 1:21 
GeneralRe: C# COM+ Client/Server Pin
SpudgunDoogal7-Jul-03 1:38
SpudgunDoogal7-Jul-03 1:38 
GeneralRe: C# COM+ Client/Server Pin
Philip Fitzsimons7-Jul-03 2:53
Philip Fitzsimons7-Jul-03 2:53 
GeneralRe: C# COM+ Client/Server Pin
Giles7-Jul-03 3:05
Giles7-Jul-03 3:05 
GeneralRe: C# COM+ Client/Server Pin
SpudgunDoogal7-Jul-03 3:10
SpudgunDoogal7-Jul-03 3:10 
GeneralCounting a datatable Pin
totig7-Jul-03 0:46
totig7-Jul-03 0:46 
GeneralRe: Counting a datatable Pin
Philip Fitzsimons7-Jul-03 2:53
Philip Fitzsimons7-Jul-03 2:53 
GeneralRe: Counting a datatable Pin
totig7-Jul-03 3:10
totig7-Jul-03 3:10 
GeneralDatagrid Combobox column Pin
Rohit Kashikar6-Jul-03 23:44
Rohit Kashikar6-Jul-03 23:44 
GeneralRe: Datagrid Combobox column Pin
perlmunger7-Jul-03 12:16
perlmunger7-Jul-03 12:16 
GeneralRe: Datagrid Combobox column Pin
7-Jul-03 18:30
suss7-Jul-03 18:30 
GeneralWM_PRINTCLIENT message Pin
peenu6-Jul-03 23:15
peenu6-Jul-03 23:15 
GeneralPDF viewer / printer component or solution - for distributed software(don't wanna use Abobe's) Pin
Selector6-Jul-03 20:20
Selector6-Jul-03 20:20 
GeneralRe: PDF viewer / printer component or solution - for distributed software(don't wanna use Abobe's) Pin
Roland Bär7-Jul-03 3:22
Roland Bär7-Jul-03 3:22 
GeneralPutting Array data in a string then showing it in a label. Pin
eggie56-Jul-03 10:48
eggie56-Jul-03 10:48 
GeneralRe: Putting Array data in a string then showing it in a label. Pin
leppie6-Jul-03 11:32
leppie6-Jul-03 11:32 
GeneralRe: Putting Array data in a string then showing it in a label. Pin
eggie56-Jul-03 14:44
eggie56-Jul-03 14:44 
GeneralRe: Putting Array data in a string then showing it in a label. Pin
leppie6-Jul-03 15:15
leppie6-Jul-03 15:15 
GeneralRe: Putting Array data in a string then showing it in a label. Pin
eggie56-Jul-03 15:44
eggie56-Jul-03 15:44 
GeneralRe: Putting Array data in a string then showing it in a label. Pin
Daniel Turini7-Jul-03 1:24
Daniel Turini7-Jul-03 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.