Hi, when I use Parameter passing, I face a problem when parameter is null or empty. Example:
(param1) Report A ---(param1) --> Report B --(param1)--> Report C
In Report A I use:
select 'dbr.report', 'sp_DBR_Report_B', 'new_popup', '[Col]', 'param1=(param1)';
and in Report B I pass it to C:
select 'dbr.report', 'sp_DBR_Report_C', 'new_popup', '[Col]', 'param1=(param1)';
In Report A, the param1 come with Parameter so it's empty, that's not problem when passing to Report B. But in Report B, the report AUTOMATICALLY convert empty to NULL, so param1 is null inside Report B.
And after that, the Report C failed because error type or something else I can't remember. The work around I chose is use this in B to prevent null value:
SET param1 = IFNULL(param1,'');
select 'dbr.report', 'sp_DBR_Report_C', 'new_popup', '[Col]', concat('param1="',param1,'"');
Of course, the statement SET param1 = IFNULL(param1, '');
not affect when use 'param1=(param1)'
and it still passing null and get error type.
Can you just simple do not convert empty to null while passing, leave it null when null? I think that's cause the problem when Report B get Null when A passing empty.
Thanks,