SSRS - данные многозначного отчета не отображаются в таблице таблиц - PullRequest
0 голосов
/ 07 ноября 2018

ниже - мой сохраненный процесс.

ALTER  PROCEDURE [dbo].[Rpt_ProgramActivityReport ] 
(

 @StartDate DATETIME   ,
  @EndDate DATETIME   ,
  @RegionId varchar(25)  = NULL,
  @OrganizationId varchar(25) = NULL  ,
  @County varchar(25) = NULL,
  @ActivityId varchar(25)  = NULL,
  @InterventionId varchar(25) = NULL,
  @Status varchar(25)  = NULL,
  @StrategyId varchar(25) = NULL,
  @MethodApproachId varchar(25)  = NULL,
  @TargetPopulationId varchar(25)  = NULL,
  @PrimaryProblemId varchar(25) = NULL,
  @SecondaryProblemId varchar(25) = NULL,
  @InterveningVariableId varchar(25) = NULL,
  @FundingSourceId varchar(25)= NULL 

)

AS 

BEGIN


SELECT 
FACT.Id fActivityId, FACT.ActivityName,
ACT.fOrganizationRegion_Id ,ACT.Id AS ActivityId,ACT.CreateUserId,
(US.LastName + ',' +US.FirstName)AS UserName,
REG.Id  AS RegionId,REG.OrganizationName AS RegionName,
ORG.Id  AS OrganizationId , ORG.OrganizationName AS OrganizationName,
FC.Id AS FundingSourceId, fc.FundingSource,
CA.Id AS CoverageAreaId, CA.County , CA.ZipCode
FROM Activities ACT
JOIN fActivity FACT ON FACT.Id = ACT.fActivity_Id
JOIN fOrganizationRegion ORGREG ON ORGREG.Id = ACT.fOrganizationRegion_Id
JOIN fOrganization REG ON REG.Id = ORGREG.RegionOrg_Id
JOIN fOrganization ORG ON ORG.Id = ORGREG.Org_Id
JOIN ActivityFundingSource AFC ON AFC.Activity_Id = ACT.Id
JOIN fFundingSource FC ON FC.Id = AFC.FundingSource_Id
JOIN ActivityCoverageArea ACA ON ACA.Activity_Id = ACT.Id
JOIN fCoverageAreas CA ON CA.Id = ACA.CoverageArea_Id
JOIN Users US ON US.UserId  = ACT.CreateUserId
LEFT JOIN fInterventionType ITYPE ON ITYPE.Id = FACT.InterventionType_Id
LEFT JOIN ActivityInterveningVariable AIVAR ON AIVAR.Activity_Id = ACT.Id
LEFT JOIN fInterveningVariables IVAR ON IVAR.Id = AIVAR.fInterveningVariable_Id
LEFT JOIN ActivitySecondaryPriorityProblem ASPP ON ASPP.Activity_Id = ACT.Id
LEFT JOIN fPriorityProblem PP ON PP.Id = ASPP.fPriorityProblem_Id
LEFT JOIN fMethodApproach MA ON MA.Id = ACT.fMethodApproach_Id
LEFT JOIN fStrategyMethodApproach  SMA ON SMA.fMethodApproach_Id = MA.Id
LEFT JOIN fStrategy ST ON ST.Id = SMA.fStrategy_Id
LEFT JOIN ActivityTargetPopulation ATP ON ATP.Activity_Id = ACT.Id
LEFT JOIN fTargetPopulation TP ON TP.Id = ATP.TargetPopulation_Id


WHERE


    (Act.CreateDate BETWEEN @StartDate AND @EndDate)
AND ( (@RegionId IS NULL) OR  REG.Id  IN( SELECT * FROM dbo.FnSplit(@RegionId ,',' )) )
AND ((@OrganizationId IS NULL) OR   ORG.Id  IN ( SELECT * FROM dbo.FnSplit( @OrganizationId ,',' )))
AND ( (@County IS NULL) OR CA.County  IN ( SELECT * FROM dbo.FnSplit( @County,',' ) ))
AND ((@ActivityId IS NULL) OR FACT.Id  IN ( SELECT * FROM dbo.FnSplit( @ActivityId ,',' ) ) )
AND ( (@FundingSourceId IS NULL) OR FC.Id  IN ( SELECT * FROM dbo.FnSplit(@FundingSourceId ,',' )) )
--AND ((@Status IS NULL) OR ACT.Completed  IN (SELECT * FROM dbo.FnSplit( @Status ,',' )))
AND ((@Status IS NULL) OR ACT.Completed  IN (SELECT * FROM dbo.FnSplit( cast(@Status as varchar) ,',' )))
AND ((@InterventionId IS NULL) OR ITYPE.Id  IN ( SELECT * FROM dbo.FnSplit( @InterventionId ,',' ) ))
AND ((@InterveningVariableId IS NULL) OR IVAR.Id  IN (SELECT * FROM dbo.FnSplit(  @InterveningVariableId ,',' )  ))
AND ((@SecondaryProblemId IS NULL) OR PP.Id  IN (SELECT * FROM dbo.FnSplit(@SecondaryProblemId  ,',' )))
AND ((@PrimaryProblemId IS NULL) OR PP.Id  IN  (SELECT * FROM dbo.FnSplit( @PrimaryProblemId ,',' )))
AND ((@MethodApproachId IS NULL) OR MA.Id  IN  ( SELECT * FROM dbo.FnSplit(@MethodApproachId ,',' ) ))
AND ((@StrategyId IS NULL) OR ST.Id  IN   ( SELECT * FROM dbo.FnSplit(@StrategyId  ,',' )))
AND ( (@TargetPopulationId IS NULL) OR TP.Id  IN (SELECT * FROM dbo.FnSplit(@TargetPopulationId,',' )))


END

когда я запускаю его, я вижу данные.также у меня есть отчет, где я использую тот же сохраненный процесс в наборе данных.пока я выполняю набор данных, я получаю записи.но когда я добавляю поля в таблицу tablix.он возвращает НЕТ записей.

Я также изменил и проверил данные с использованием приведенных ниже кодов в параметрах в наборе данных.

=Join(Parameters!RegionId.Value,",")
=Join(Parameters!OrganizationId.Value ,",")
=Join(Parameters!County.Value,",")
=Join(Parameters!ActivityId.Value,",")
=Join(Parameters!InterventionId.Value,",")
=Join(Parameters!Status.Value,",")
=Join(Parameters!StrategyId.Value,",")
=Join(Parameters!MethodApproachId.Value,",")
= Join(Parameters!TargetPopulationId.Value,",")
= Join(Parameters!PrimaryProblemId.Value,",")
= Join(Parameters!SecondaryProblemId.Value,",")
= Join(Parameters!InterveningVariableId.Value,",")
= Join(Parameters!FundingSourceId.Value,",")

, но проблема в том, что я все еще получаю записи при выполненииданные устанавливаются отдельно.но в отчете tablix он не отображает данные.Может ли кто-нибудь помочь мне в этом .??

...