Showing posts with label inserted. Show all posts
Showing posts with label inserted. Show all posts

Friday, March 30, 2012

Reporting Services Stored Procedure Dataset

I have a big SQL Stored Procedure which works with a cursor inside of it. During the procedure the data is inserted into a table and at the end is a SELECT statement from that table. The problem is that when i create a dataset with that stored procedure and i run it in the Data tab i get the correct select, but in the Fields section of the Report I don't get the fields from the last SELECT, but the fields from the cursor. Am I doing something wrong or is this a bug and how can i fix it.
Thanks!does it return the correct result set when you run it from QA ?|||Yes, it does return the correct dataset. I am using sql 2005 and if I have the procedure like his:

DECLARE Mycusor CURSOR FOR SELECT Field1, Field2, ...
OPEN CURSOR ...
FETCH NEXT ...
WHILE @.@.FETCH_STATUS > 0 ...
INSERT INTO tmp ...

SELECT * FROM tmp

If the procedure is like this then in Sql 2005 when i run it i get the data from tmp and in Reporting Services i get a dataset containg Field1, Field2 with no rows in it.
Do you have any idea?|||dont you have a close/deallocate cursor ? heres a template for a cursor.


DECLARE rs CURSOR
LOCAL
FORWARD_ONLY
OPTIMISTIC
TYPE_WARNING
FOR SELECT
OPEN rs
fetch next from rs into
WHILE ( @.@.FETCH_STATUS = 0 )
begin
-- your DML stmts.

FETCH NEXT FROM rs INTO
END

close rs
deallocate rs

and you would need to do a select after deallocating the cursor.

hth

Friday, March 23, 2012

Reporting services problem

Hi, I'm trying to use the reporting services in ASP.NET page.

- I've inserted an ReportViewer object my ASP.NET
- I've a datatable with the info that I want to see in my report

Now I must to create the DataSource object? How can I create a DataSource for this solution?? Somebody can send me an example?

Thanks

Please help me!!!Sad|||Before that you need to create the report.
In fact the ReportViewer is just a container for the report.
In VS you need to do : right click on project / insert new item / Report.
Which version of SRS do you use ?|||

Sorry I didn't see the date of your post !!
I think it's too late to answer ;-)
and I think you were using VS2003...