我正在使用带有 tablix 的 SSRS 2008。我想让我的行之一可见,当字段值 = 1 时,当这个值 = 0 时不可见。如何配置它?现在我右键单击行并输入表达式的字段值。然后我说“= 1”表示可见。我也试过:=“1”(文本),真,“真”。
但是所有这些结果在行中总是出现,不管它是 1 还是 0。这是一个整数字段值。如何根据值重写表达式以使该行可见或不可见?
我认为现在的问题是 T-SQL 而不是 SSMS。目前,它在单独的行上返回这些记录。相反,我认为我只需要一行上的所有这些值,以便所有这些值可以一次出现在表中。我如何重写此代码段以仅在一行上返回相同的信息?
CASE WHEN [test_details].[test_setup_details_caption] LIKE '%?%'
THEN LEFT([test_details].[test_setup_details_caption],CHARINDEX('?',[test_details].[test_setup_details_caption]))
ELSE [test_details].[test_setup_details_caption] END [test_setup_details_caption],
[test_details_answers_expanded_view].[test_setup_answers_value],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Self-Harm', 'Suicidal Ideations / Attempts')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Self_Harm_Flag],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Substance Abuse / Drug Use')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Drug_Use_Flag],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Homicidal Ideations / Attempts')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Homicidal_Falg],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Runaway Behavior')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Runaway_Flag],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Problem Sexual Behavior', 'Inappropriate Sexual Behavior')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Sexual_Bx_Flag],
CASE WHEN [test_details].[test_setup_details_caption] in ( 'Gang Involvement')
AND [test_details_answers_expanded_view].[test_setup_answers_value] >0 THEN 1 ELSE 0 END AS [Gang_Flag]