SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Report works in Visual Studio but not in Report Manager


Report works in Visual Studio but not in Report Manager

Author
Message
SQL Swerver
SQL Swerver
SSC Eights!
SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)

Group: General Forum Members
Points: 808 Visits: 536
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?
Rodney Workman
Rodney Workman
SSC Journeyman
SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)SSC Journeyman (85 reputation)

Group: General Forum Members
Points: 85 Visits: 152
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
SQL Swerver
SQL Swerver
SSC Eights!
SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)

Group: General Forum Members
Points: 808 Visits: 536
Those are some excellent ideas and certainly food for thought. I'll give that a go and report my findings here.
SQL Swerver
SQL Swerver
SSC Eights!
SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)

Group: General Forum Members
Points: 808 Visits: 536
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.
SPWard
SPWard
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 43
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.
SQL Swerver
SQL Swerver
SSC Eights!
SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)

Group: General Forum Members
Points: 808 Visits: 536
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 Smile

Your input is much appreciated however, keep it up Smile
SPWard
SPWard
SSC Rookie
SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)SSC Rookie (33 reputation)

Group: General Forum Members
Points: 33 Visits: 43
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.
SQL Swerver
SQL Swerver
SSC Eights!
SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)SSC Eights! (808 reputation)

Group: General Forum Members
Points: 808 Visits: 536
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!
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search