Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

SSRS Report does not display Result set though the dataset (Stored procedure/SQL query) returns result set

$
0
0

I have following issue 

I am creating a simple SSRS table report through Report Builder. My dataset is looking for the stored procedure . When I execute the Stored procedure through SSMS I get resutset for certain parameters. I execute the dataset  (Store procedure) through query designer in dataset properties and I get results back. But when I try to run the report and see the preview, I do not get any results displayed. I been looking on the same issue form last 3-4 days and have not found any clue. Can somebody please help me.

Following is the stored procedure I am using. Also I am passing multivalued parameter through report as well, and I am using spilt function to seperate the libraryid I am reading from parameter values. This works fine. 

I have similar kind of four other reports and with different stored procedure which exactly follow the same method , like multivalue parameters and other criteria are also very similar. All other reports works just fine .

           

This perticular report has issue for displying results, following is the stored procedure I am using 

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[ReportUserReview]
@libraryId varchar(4000),
@reviewStartDate datetimeoffset,
@reviewEndDate datetimeoffset =null
AS
BEGIN
SELECT LP_NAME.KeyValue LibraryName, O.ISBN, O.Title, O.Author, O.BisacDesc, O.SupplierDesc as Publisher,  A.LibraryID,
  A.ItemID, ISNULL(CT.TotalCirculation,0) TotalCirculation, ISNULL(CT.CurrentCirculation,0) CurrentCirculation,
  CAST(CT.TotalCirculation As DECIMAL(6,2))/CAST(A.TotalQuantity AS DECIMAL(6,2)) Turns,
 (DATEDIFF(Day,A.CreateDate,GetDate()))/nullif(CAST(CT.TotalCirculation As DECIMAL(6,2))/CAST(A.TotalQuantity AS DECIMAL(6,2)),0) DaysToTurn,
  A.TotalQuantity QuantityOwned,A.CreateDate AddedDate,
  O.PubDate ,  COALESCE (HQ.TotalHolds ,0)CurrentHolds,
  COALESCE (IR.NumOfReviews,0) NumberOfReviews 
FROM Availability A
   INNER JOIN LibraryProperty LP_ID
ON LP_ID.PropertyID = '18'
AND A.LibraryID = LP_ID.LibraryID 
   AND LP_ID.KeyValue IN  (SELECT * FROM dbo.SplitLibrary(@libraryId, ','))
INNER JOIN LibraryProperty LP_NAME
ON LP_NAME.PropertyID = '7'
 AND A.LibraryID = LP_NAME.LibraryID
INNER JOIN OMNI.dbo.OMNI O
ON A.ItemID = O.BTKey
LEFT JOIN (SELECT P.LibraryID, C.ItemID,  COUNT(*) TotalCirculation,
              SUM(CASE WHEN C.IsValid = 1 THEN 1 ELSE 0 END) CurrentCirculation
            FROM CheckoutTransaction C           
            INNER JOIN Patron P
            ON C.PatronID = P.ID                   
            GROUP BY P.LibraryID, C.ItemID ) CT
ON A.ItemID = CT.ItemID
AND upper(A.LibraryID) = upper(CT.LibraryID)
LEFT JOIN (SELECT P.LibraryID, H.ItemID,  COUNT(*) TotalHolds
           FROM HoldTransaction H
           INNER JOIN Patron P
            ON H.PatronID = P.ID
           GROUP BY P.LibraryID, H.ItemID) HQ
  ON A.ItemID = HQ.ItemID
  AND A.LibraryID = HQ.LibraryID
  INNER JOIN (SELECT ItemID, LibraryID,COUNT(ID) NumOfReviews
 FROM UserReview
 WHERE DATEDIFF(DAY, @reviewStartDate, ReviewDate) >= 0
 AND DATEDIFF(DAY, ReviewDate, ISNULL(@reviewEndDate,GETDATE())) >= 0
  GROUP BY ItemID,LibraryID
  HAVING COUNT(ID)>0 ) IR
  ON A.LibraryID = IR.LibraryID
  AND A.ItemID = IR.ItemID
END

Any help appreciated


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>