Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Report works in Visual Studio but not in Report Manager Expand / Collapse
Author
Message
Posted Tuesday, February 19, 2013 9:36 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:12 AM
Points: 72, Visits: 394
Scenario: I have a report which works fine in SSRS. I need to add a parameter to allow the dataset to be filtered by a Time-range, eg. last 7, 14, 28 days or 'Calendar' (Time/Date Selector) so I create a Parameter with four available values (last 7 days, last 14 days, last 28 days and Calendar-which returns (Null). It's a drop-down value which I will refer to as a Switch.
I added logic to the underlying stored procedure to look for these values which then adds to the WHERE clause in the query. It looks for dates within the date-range (or all dates if the parameter is null). There is other logic too which looks ats the Calendar values if my new Switch is Null, but that's not important here.
This report now runs exactly as I need it to in VS2008, BUT, when I deploy the report to SSRS 2008 R2 the report returns no data at all regardless of which value in the Switch I select. Also, it errors with:

An error has occurred during report processing. (rsProcessingAborted)
Cannot read the next data row for the dataset ds_xxxxx. (rsErrorReadingNextDataRow)
Arithmetic overflow error converting expression to data type datetime.

If I download the RDL file back out of SSRS and run it in VS2008, it works fine!!! What am I missing, it must be a configuration item maybe within the Config file for SSRS, but what?
Post #1421723
Posted Tuesday, February 19, 2013 10:58 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, February 04, 2014 6:59 AM
Points: 15, Visits: 119
Now that you are running from the Report Server, is your connection pointed to the same database? Can you use sql profiler to see the messaging occurring between SSRS and SQL. When the report is run from SSRS what is the parameter value passed to the report server? Then use profiler when running from visual studio, what value is passed from here.

In general, the thought running through my head is the same input in for the same stored procedure should give the same output. So is the input somehow different or is the stored procedure not the same? Is there a permission issue running from report server that is not present when running from visual studio?

Hope this give you some ideas.

Rodney
Post #1421772
Posted Tuesday, February 19, 2013 11:43 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:12 AM
Points: 72, Visits: 394
Those are some excellent ideas and certainly food for thought. I'll give that a go and report my findings here.
Post #1421793
Posted Thursday, February 21, 2013 4:22 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:12 AM
Points: 72, Visits: 394
Quick Update: (I've not been able to work on this for two days)

This problem is due to User Permissions but I have yet to work out why (it's basically the same stored procedure as the original which works fine).

SQL Profiler returns the same query (calls the same Stored Procedure) using identical parameters whether the report is executed via VS2008 or SSRS 2008 R2.

So I use the extracted T-sql being called and ran the SP under both accounts (mine and the SSRS acct), the SSRS account returns no rows (but mine does).

However, this Stored Procedure has the same permissions (Execute-Grant) assigned to the same role so I'm stumped.

Will post further findings here.
Post #1422497
Posted Thursday, February 21, 2013 2:33 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, February 09, 2014 10:27 PM
Points: 7, Visits: 39
Could it be that VS is using your credentials and SSRS is using a different set? I had an issue with old SQL jobs trying to use SA and those rights would not cross to another server to create a connection. Still very much a SQL n00b, but figuring this stuff out the hard way.
Post #1422794
Posted Friday, February 22, 2013 2:52 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:12 AM
Points: 72, Visits: 394
yes, you are right, that is absolutely the case that VS is using my local client account and SSRS is using its own User account. It does appear that User Permissions is the answer but it could be a red-herring because the Stored Procedure has changed but it still exists as before and the permissions on that SP have not changed.
It's a weird one which has our whole team stumped :)

Your input is much appreciated however, keep it up :)
Post #1422942
Posted Friday, February 22, 2013 7:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, February 09, 2014 10:27 PM
Points: 7, Visits: 39
It might be because I have no idea and please correct me if I am wrong. I thought a SP when executed by SQL agent uses the owner ID. If that is a domain account, it should be able to cross servers and capture data from both. However, if the account is local only to the SQL server, that it will not be able to connect to another server to gather data.

The only reason I say this, is that on an older 2000 box with some old jobs i have, they will run if I am logged in to it and manually run it, but won't run on a schedule. I ended up recreating the task in SSRS and it runs. I know enough SQL to be very dangerous, but trying to enhance my knowledge.
Post #1423060
Posted Friday, February 22, 2013 8:27 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:12 AM
Points: 72, Visits: 394
Again, you are right; Local database accounts are exactly that, they cannot authenticate in other instances (or servers).
Generally, it is very bad security practice to even have the sa account enabled let alone used to run things (very bad). Until you've understood why (as a Newbee :0) it's probably best to take my word for it!
Post #1423098
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse