2017-10-04 111 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」的答案。