I am connecting to a SQL Server 2014 database using SSRS 2014. I have used SSRS since its initial version, but have never experienced this problem, so I donβt know if there is an error in SSRS 2014. I have a stored procedure that returns some data something simple:
CREATE PROCEDURE [dbo].[GetNewsletterStories] @NewsletterID int, @IsMainStory int=2 --2 is both, 1 is true, 0 is false AS BEGIN SET NOCOUNT ON; SELECT ns.SortOrder as SortOrder, ns.Title, ns.Description, ns.LinkText, ns.LinkURL, ns.PictureName, ns.IsMainStory FROM NewsletterStory ns INNER JOIN Newsletter n ON n.NewsletterID = ns.NewsletterID WHERE n.Deleted=0 AND ns.Deleted=0 AND n.NewsletterID = @NewsletterID --do they want non main story or main story or both AND ((ns.IsMainStory = 0 AND @IsMainStory=0) OR (ns.IsMainStory = 1 AND @IsMainStory=1) OR (@IsMainStory=2)) ORDER BY ns.SortOrder END
If I started the stored procedure from Management Studio like this:
USE [MyDB] GO DECLARE @return_value int EXEC @return_value = [dbo].[GetNewsletterStories] @NewsletterID = 1, @IsMainStory = 1 SELECT 'Return Value' = @return_value GO
I get exactly what I need in the correct order:

Then I am in SSRS, and I create my dataset and can go to the query designer and run it:

Here he will tell me my options:

I get exactly what I need:

So far, so good, I added my tablix and set its dataset name that I created, and even went as far as setting the sort section to [SortOrder] based on the column in my dataset:

Every time I run my report, I get the wrong sort order:

I just thought that it should cache some old version, so I will definitely delete the MyReport.rdl.data report files to get a fresh report. No, this also shows Concerto Integration, and then RIMS Newsletter ... but my dataset and my stored procedure return the correct order for RIMS Newsletter and Concerto Integration. I tried everything, but it always seems to sort by the first key of the table (when the article was created, since I created the Concerto Integration article before the RIMMS Newsletter article).
I donβt know where else to look, I even checked the resulting XML (code view function), and SortOrder in the data set. Even if I delete this SortOrder , it should work, because the stored procedure is already sorted by it, as you see in the code.
What gives?