Hey Hemalatha,
Using an IN clause is available in Catalog 14.1, but not in 12.7. But with some tricks you can manage it.
Let me explain you how i did it :
First of all, you will need a new function on your SQL Server to parse comma separated string and return a table
Something like (I found this function on stackOverflow) :
create function splitString
(
@input NVARCHAR(MAX),
@Character CHAR(1)
)
returns @Output TABLE (Item NVARCHAR(1000))
AS
BEGIN
DECLARE @StartIndex INT, @EndIndex INT
SET @StartIndex = 1
IF SUBSTRING(@Input, LEN(@Input)-1, LEN(@Input)) <>@Character
BEGIN
SET @Input=@Input+@Character
END
WHILE CHARINDEX(@Character,@Input) >0
BEGIN
SET @EndIndex = CharIndex(@Character, @Input)
INSERT INTO @Output(Item)
SELECT SUBSTRING(@Input,@StartIndex,@EndIndex -1)
SET @Input = SUBSTRING(@Input, @EndIndex+1, LEN(@Input))
END
RETURN
END
GO
You need two report object :
First one (For region in your case i assume)
select id as value, name as label from tableRegion
Second one (For sub-region in your case)
select id as value, name as label from tableSubRegion where idRegion in (select * from splitString(%STRING%,','))
On your sub-regions list you can add this one in the attribute to specify the variables for the report object
$({'STRING':ca_fdGetSelectedOptionValues(ca_fd.formId,'lst_region').join()})
And for the attribute on change of your regions select, you can add :
ca_fd.js.selectRegion()
And define the selectRegion function in your script :
selectRegion : function()
{
ca_fdFetchSelectData(ca_fd.formId,'lst_subRegion');
},
Hope this helps
Pier