Hello,
I'm a pretty experienced Crystal user but I've never had to use a command object. In this case, what I'm using it for is to call a stored procedure, which then pre-aggregates a very complex dataset in the database (Oracle 9i). I don't know why Crystal doesn't give you a simple option to just execute a SP before running a report, they want you to create a package and actually draw the results out of it, very convoluted and unncessary.
So I've created a parameter and the command object, here is the command object syntax:
BEGIN EE_SETMASTERDATE_SP (to_char({?NewDtParam},'YYYYMMDD')); END;
FYI, if you ever have to do this one of the tricks is that you can't have returns in the box, everything has to be on 1 line even though it will wrap.
Now the incredibly frustrating part: it will refresh correctly once, when the report opens and you choose a date. Then even if you press the refresh button, the main report will refresh but the command objects will not call the database again. I can be sure it is not the DB's fault because I can mess up the syntax of this SP and it doesn't catch it until you either restart crystal or close and reopen the report, which also makes a real refresh happen.
I've tried every possible combo of the "refresh on open" etc. buttons. This is Crystal Reports XI on Win XP. This is just such silliness, I feel like there must be a secret registry setting or something to make it work.
I know this is kind of out there...not many people use command objects...TIA for any ideas.
I'm a pretty experienced Crystal user but I've never had to use a command object. In this case, what I'm using it for is to call a stored procedure, which then pre-aggregates a very complex dataset in the database (Oracle 9i). I don't know why Crystal doesn't give you a simple option to just execute a SP before running a report, they want you to create a package and actually draw the results out of it, very convoluted and unncessary.
So I've created a parameter and the command object, here is the command object syntax:
BEGIN EE_SETMASTERDATE_SP (to_char({?NewDtParam},'YYYYMMDD')); END;
FYI, if you ever have to do this one of the tricks is that you can't have returns in the box, everything has to be on 1 line even though it will wrap.
Now the incredibly frustrating part: it will refresh correctly once, when the report opens and you choose a date. Then even if you press the refresh button, the main report will refresh but the command objects will not call the database again. I can be sure it is not the DB's fault because I can mess up the syntax of this SP and it doesn't catch it until you either restart crystal or close and reopen the report, which also makes a real refresh happen.
I've tried every possible combo of the "refresh on open" etc. buttons. This is Crystal Reports XI on Win XP. This is just such silliness, I feel like there must be a secret registry setting or something to make it work.
I know this is kind of out there...not many people use command objects...TIA for any ideas.