I have a single SP that I use to populate my data sets, something like this:
CREATE PROCEDURE RptSample
SELECT Col1, Col2, Col3
WHERE Id = @Id
AND Date BETWEEN @From AND @To
IF @DSVar = 'Tablix01'
-- Code to populate data set for Tablix 01 from #TMP
ELSE IF @DSVar = 'Tablix02'
-- Code to populate data set for Tablix 02 from #TMP
ELSE IF @DSVar = 'Tablix10'
-- Code to populate data set for Tablix 10 from #TMP
Each data set uses the above parameters, values for @Id, @From, @To will be the same for each data set, however @DSVar will be different for each (Tablix01, Tablix02, etc.). My problem is that the SP gets executed 10 times (once for each data set) when I run the report.
Since each data set is populated from #TMP I would only like this to be executed once. Any ideas how this could be resolved? Thank you.