Я хочу показать некоторые данные в отчет с помощью хранимой процедуры:данные не отображаются в отчете SSRS, но execting запрос в SQL показывает данные
ALTER PROCEDURE [dbo].[usp_GetThirtyDaysSims]
(
@DateFrom DATETIME = NULL,
@DateTo DATETIME = NULL,
@O2QuarterStartDate INT = NULL,
@AreaId INT = NULL,
@StoreId INT = NULL,
@O2MonthStartDate INT = NULL,
@TransactionType NVARCHAR(1000)
)
AS
BEGIN
DECLARE @O2Quarter AS INT
DECLARE @O2Year AS INT
DECLARE @O2Month AS INT
IF (@AreaId = 0 OR @AreaId = 999999999)
BEGIN
SET @AreaId = NULL
END
IF (@StoreId = 0 OR @StoreId = 999999999)
BEGIN
SET @StoreId = NULL
END
IF (@O2QuarterStartDate = 0 OR @O2QuarterStartDate = 999999999)
BEGIN
SET @O2QuarterStartDate = NULL
END
IF (@O2MonthStartDate = 0 OR @O2MonthStartDate = 999999999)
BEGIN
SET @O2MonthStartDate = NULL
END
IF(@O2QuarterStartDate IS NOT NULL)
BEGIN
SELECT @O2Quarter = O2Quarter,@O2Year = O2Year
FROM DimDate
WHERE [email protected]
SELECT @DateFrom = MIN([Date]),@DateTo = MAX([Date])
FROM DimDate
WHERE [email protected] AND [email protected]
END
IF(@O2MonthStartDate IS NOT NULL)
BEGIN
PRINT @O2MonthStartDate
SELECT @O2Month=O2Month, @O2Quarter = O2Quarter,@O2Year = O2Year
FROM DimDate
WHERE [email protected]
SELECT @DateFrom = MIN([Date]),@DateTo = MAX([Date])
FROM DimDate
WHERE [email protected] AND [email protected] AND [email protected]
END
SELECT Area,StoreName,SUM(Tariff) SumOfTariff, COUNT(1) NoOfSimsSold
FROM [dbo].[ufn_GetThirtyDaysSimsData](@DateFrom,@DateTo) FT
INNER JOIN DimDate DD ON FT.TransactionDateId = DD.DateKey
WHERE (@DateFrom IS NOT NULL AND DD.[Date] >= @DateFrom)
AND (@DateTo IS NOT NULL AND DD.[Date] <= @DateTo)
AND (FT.AreaId = @AreaId OR @AreaId IS NULL)
AND (FT.StoreId = @StoreId OR @StoreId IS NULL)
AND (FT.TransactionType = @TransactionType OR @TransactionType IS NULL)
GROUP BY Area,StoreName
ORDER BY Area,StoreName
END
Когда я фильтровать с помощью 7 фильтров выше, данные не отображается в отчете, но ошибок нет - почему это может быть?