If you want to pass NULL values to a linked report, you might want to change myDBR default setting where strings pass empty strings pass and numeric pass zero when empty value is passed. You can do this by adding:
$mydbr_defaults['parameters']['empty_numeric_results_null'] = true;
$mydbr_defaults['parameters']['empty_string_results_null'] = true;
Into your user/defaults.php.
To pass NULL values into a linked report, just add a NULL column into your result set (you can hide it). So if you Date and Order column and you want to link same report to both columns, you would use:
select 'dbr.report', 'sp_DBR_detail', '[Date]', 'inDate=Date', 'inOrder=nullcolumn';
select 'dbr.report', 'sp_DBR_detail', '[Order]', 'inOrder=Order', 'inDate=nullcolumn';
select 'dbr.hidecolumn', 'nullcolumn';
select col1, col2, order_column as 'Order', date_column as 'Date', null as 'nullcolumn'
from yourdata;
In the detail report use the values in comparision if they exist:
create procedure sp_DBR_detail(
inDate date,
inOrder varchar(20)
)
begin
select col1, col2, col3
from yourdata
where date_column = ifnull( inDate, date_column ) and order_column = ifnull( inOrder, order_column );
end
If you are on MS SQL Server or Sybase, you can use isnull() instead of ifnull().
Alternatively you can just cretate own detail reports for both columns.
--
myDBR Team