問題は、Management studio で実行されたクエリが正しい結果を返し、SSRS では返されないことです。たとえば、列 OriginAndDestinationAddress の Management Studio では、次のように返されます。
"1691 W Warren Blvd, Chicago -> 697 N Frances St, South Bend"
しかし、データセットではこれを返します:
"W Warren Blvd, Chicago -> 697 N Frances St, 1691 South Bend"
したがって、両方のケースで同じクエリを使用していますが、結果が異なり、原因がわかりません。
これはクエリ(データセット)です:
SELECT CAA.Line1 + ', ' + CAA.City + ' -> ' + CAB.Line1 + ', ' + CAB.City AS OriginAndDestinationAddress, CAA.Line1 + ',' + CAA.City AS OriginAddress,
CAB.Line1 + ',' + CAB.City AS DestinationAddress, CSI.Height * CSI.Weight * CSI.Depth AS Volume, CSI.Quantity, ISNULL(CSI.ItemVolume, 0) AS ItemVolume,
ISNULL(CSI.HeavyItem, 0) AS HeavyItem, ISNULL(CSI.Damaged, 0) AS Damaged, ISNULL(CSI.DisassemblyReq, 0) AS DisassemblyReq, ISNULL(CSI.AssemblyReq,
0) AS AssemblyReq, ISNULL(CSI.PackingReq, 0) AS PackingReq, ISNULL(CSI.UnpackingReq, 0) AS UnpackingReq, ISNULL(CSI.Electrical, 0) AS Electrical,
ISNULL(CSI.Weight, 0) AS Weight, SIL.ItemName, CAA.Line1, CAA.City, CAB.Line1 AS Expr1, CAB.City AS Expr2
FROM Quote AS Q INNER JOIN
CustomerSurvey AS CS ON CS.CustomerSurveyId = Q.CustomerSurveyId INNER JOIN
CustomerSurveyItem AS CSI ON CSI.CustomerSurveyId = CS.CustomerSurveyId INNER JOIN
SurveyItem AS SI ON SI.SurveyItemId = CSI.SurveyItemId INNER JOIN
SurveyItemLabel AS SIL ON SIL.SurveyItemId = SI.SurveyItemId INNER JOIN
CustomerSurveyAddress AS CSAA ON CSAA.CustomerSurveyAddressId = CSI.OriginAddressId INNER JOIN
CustomerSurveyAddress AS CSAB ON CSAB.CustomerSurveyAddressId = CSI.DestinationAddressId INNER JOIN
CustomerAddress AS CAA ON CAA.CustomerAddressId = CSAA.CustomerAddressId INNER JOIN
CustomerAddress AS CAB ON CAB.CustomerAddressId = CSAB.CustomerAddressId inner join SurveyItemRoom as SIR on SI.SurveyItemId = SIR.SurveyItemId
WHERE (Q.QuoteId = @quoteId) AND (SIL.LangId = @CultureId)
GROUP BY CAA.Line1, CAA.City, CAB.Line1, CAB.City, CSI.Height * CSI.Weight * CSI.Depth, CSI.Quantity, CSI.ItemVolume, CSI.HeavyItem, CSI.Damaged, CSI.DisassemblyReq,
CSI.AssemblyReq, CSI.PackingReq, CSI.UnpackingReq, CSI.Weight,CSI.CustomerSurveyItemId, SIL.ItemName, CAA.Line1, CAA.City, CAB.Line1, CAB.City, CSI.Electrical