Showing posts with label inconsistent. Show all posts
Showing posts with label inconsistent. Show all posts

Friday, March 23, 2012

Problem with inconsistent report data

I am generating a report using Sql Reporting Services, with Sql Server 2000 as the backend. Sometimes, the report shows data which is not matching with the actual data available in the database. Though the query, which is used by the report is tested in the query analyser and it is successful.

Anyone, who can solve this issue, please !!!

Where are you running the report from? Browser or report viewer or Visual Studio?

If you are using the preview tab in VS then please note that some data gets cached in a <rdl name>.data file on your local drive (same directory as the RDL file). Could this caching be causing your issue?

|||

Thanx Adam.

I tried the report in the preview and also in the browser, the result is the same. The data to the report is generated by using a cursor

declare @.count uniqueidentifier
declare cursor_a cursor for select Busi_ID from Temp_View_BusinessUnit
open cursor_a
fetch next from cursor_a into @.count
insert into Temp_BusinessUnit select distinct(businessunitid)
from FilteredBusinessUnit
where FilteredBusinessUnit.businessunitid in
(select businessunitid from FilteredBusinessUnit where parentbusinessunitid = @.count )
and FilteredBusinessUnit.businessunitid not in (select Busi_ID from Temp_View_BusinessUnit)
WHILE @.@.FETCH_STATUS = 0
BEGIN
fetch next from cursor_a into @.count
insert into Temp_BusinessUnit select distinct(businessunitid) from FilteredBusinessUnit where
FilteredBusinessUnit.businessunitid in
(select businessunitid from FilteredBusinessUnit where parentbusinessunitid = @.count )
and FilteredBusinessUnit.businessunitid not in (select Busi_ID from Temp_View_BusinessUnit)
end
deallocate cursor_a

Is the cursor is the problem to this, because whenever I refresh the report preview or the browser the output from the repor is different and rarely it matches with the actual data in the database. But the same query gives the correct output when executed under the data tab.

I hope that this is what you are expecting.