Report works in Visual Studio but not in Report Manager

  • 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?

  • 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

  • Those are some excellent ideas and certainly food for thought. I'll give that a go and report my findings here.

  • 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.

  • 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.

  • 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 🙂

  • 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.

  • 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!

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply