Sorry for blowing up the forum these last few days. Hopefully after this I should be set for a while. I have a few reports where I would like the user to select whether they want to run this report by List or by Campaign, but I can't get the multi-select to work after they select an option. The first parameter is a very simple radio button which uses the code select 1, 'Lists' union select 0, 'Campaigns'
. This is properly setting the value as either 1 or 0 and I have confirmed this by having it output on the report as the only parameter. After that I have a select list with the multiselect box checked. That parameter calls a procedure which is as follows:
DROP PROCEDURE IF EXISTS sp_ADBR_ListsCampaignsMulti
$$
CREATE PROCEDURE `sp_ADBR_ListsCampaignsMulti`(ListsOrCampaigns tinyint, userInput varchar(255))
BEGIN if (ListsOrCampaigns = '1') then select list_id, concat(list_id, " - ", list_name) from asterisk.vicidial_lists where list_id like concat('%', userInput, '%') order by list_id limit 40;
else select campaign_id, concat(campaign_id, " - ", campaign_name) from asterisk.vicidial_campaigns where campaign_id like concat('%', userInput, '%') order by campaign_id limit 40;
end if; END
$$
Whenever I try to run it, I get a message stating "The results could not be loaded". This same query is working fine when it is not a connected parameter and exists on its own:
DROP PROCEDURE IF EXISTS sp_ADBR_SelectLists
$$
CREATE PROCEDURE `sp_ADBR_SelectLists`(inLists varchar(255))
BEGIN select list_id, concat(list_id, " - ", list_name)
from asterisk.vicidial_lists
where list_id like concat('%', inLists, '%')
order by list_id limit 40; END
$$
Any help would be appreciated. Thanks.