2017-10-04 119 views
0

我建立与下面的查询事故报告不同:系列的颜色是传说色彩图表

SELECT Incident_Logged 
     ,Location_Name 
     ,Incident_Type 
     ,Body_Part_Name 
FROM Incident 
INNER JOIN Location ON Location_ID = Incident_Location_ID 
INNER JOIN Body_Part ON Body_Part_ID = Incident_Body_Part_ID 
WHERE Incident_Logged BETWEEN @StartDate and @EndDate 
AND Incident_Location_ID IN (@Location) 
ORDER BY Incident_Logged DESC 

我还创建了一个图表,但由于某种原因在图表唐的颜色” t与传说相符。有任何想法吗?

回答

0

原来,这是一个 功能 错误 如果您使用COUNT()聚合,则会发生已知问题。我用的1查询的增值一个伪列解决这个问题:

SELECT Incident_Logged 
     ,Location_Name 
     ,Incident_Type 
     ,Body_Part_Name 
     ,1 Incident_Sum 
FROM Incident 
INNER JOIN Location ON Location_ID = Incident_Location_ID 
INNER JOIN Body_Part ON Body_Part_ID = Incident_Body_Part_ID 
WHERE Incident_Logged BETWEEN @StartDate and @EndDate 
AND Incident_Location_ID IN (@Location) 
ORDER BY Incident_Logged DESC 

一旦你这样做,值更改为新列的总和。一旦你这样做,你的颜色应该排队。

来源:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0dc8aad4-b846-476d-a429-f8fc2312c585/ssrs-2008-chart-legend-colours-not-matching-series-colour?forum=sqlreportingservices - 寻找“softworks phil smith”的答案。