I am using CRXI SP2, MS2005. I have created a report from a stored procedure that uses two parameters.
The first parameter is {?schedule/on-demand}. Where the user chooses either "S" or "O". If an "O" is selected the user needs to fill in the second parameter {?inputdate}.
If the user selects "S" then I need the report to run from the (CurrentDate).
The problem is the the stored procedure input is the second parameter {?inputdate}. It can only be left blank if the user selects NULL, where the report then overrides my CurrentDate formula and sends NULL to the stored procedure.
The following is my report criteria formula:
Shared StringVar BeginDate;
Shared StringVar EndDate;
// Scheduled
IF {?Scheduled/On-Demand} = 'S' THEN
(
BeginDate:= ToText(DATEADD('d', -7, CurrentDate));
EndDate:= ToText(DATEADD('d', -1, CurrentDate));
)
//On-demand
ELSE IF {?Scheduled/On-Demand} = 'O' THEN
(
BeginDate:= ToText(DATEADD('d', -7, {?@inputdate}));
EndDate:= ToText(DATEADD('d', -1, {?@inputdate}));
)
Also, here is my record selection formula:
({?Scheduled/On-Demand} = 'S' and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) >= DATEADD("d", -7, Currentdate)
and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) <= DATEADD("d", -1, CurrentDate))
or
({?Scheduled/On-Demand} = 'O' and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) >= DATEADD("d", -7, {?@inputdate})
and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) <= DATEADD("d", -1, {?@inputdate}))
I have been able to create this report using a View, but the powers that be would like it done using a Stored Procedure and I am at a loss as to what I am doing wrong. Can any one please advise...
The first parameter is {?schedule/on-demand}. Where the user chooses either "S" or "O". If an "O" is selected the user needs to fill in the second parameter {?inputdate}.
If the user selects "S" then I need the report to run from the (CurrentDate).
The problem is the the stored procedure input is the second parameter {?inputdate}. It can only be left blank if the user selects NULL, where the report then overrides my CurrentDate formula and sends NULL to the stored procedure.
The following is my report criteria formula:
Shared StringVar BeginDate;
Shared StringVar EndDate;
// Scheduled
IF {?Scheduled/On-Demand} = 'S' THEN
(
BeginDate:= ToText(DATEADD('d', -7, CurrentDate));
EndDate:= ToText(DATEADD('d', -1, CurrentDate));
)
//On-demand
ELSE IF {?Scheduled/On-Demand} = 'O' THEN
(
BeginDate:= ToText(DATEADD('d', -7, {?@inputdate}));
EndDate:= ToText(DATEADD('d', -1, {?@inputdate}));
)
Also, here is my record selection formula:
({?Scheduled/On-Demand} = 'S' and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) >= DATEADD("d", -7, Currentdate)
and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) <= DATEADD("d", -1, CurrentDate))
or
({?Scheduled/On-Demand} = 'O' and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) >= DATEADD("d", -7, {?@inputdate})
and Date({aaa_BALANCE_WEEKLY_TOTALS_BYDAY_SCHEDULED;1.DATE}) <= DATEADD("d", -1, {?@inputdate}))
I have been able to create this report using a View, but the powers that be would like it done using a Stored Procedure and I am at a loss as to what I am doing wrong. Can any one please advise...