ReportParameterValueNotSetException in SSRS subscription - reporting-services

I am not getting this error locally in VS 2005
or when running the report through the preview
but during subscription I start getting
ReportParameterValueNotSetException
even though all my parameters especially the one it's complaining about is set
this has started happening all of a sudden and has been working great before.
Any ideas why this might have happened

You could try deploying the report with a different name and see if subscriptions for it have the same problem. If it does not, then blame cosmic rays. It happens. In that case, delete the old report entirely from the server and then you should be able to deploy with the original name again.
If it continues to happen, then I'd start looking at what's different between running it live and running it through a subscription. Usually it's permissions related. Or perhaps the time of day the subscription fires off vs the time of day you test it live.

Is the parameter value used for the subscription hard coded, or is it based on another query?
If the latter
- does the query used for this param gen purpose work?
- does it return the correct datatype/expected data?
- does it work at the time you are running the report (database is online, has permissions set correctly)?

Related

SSRS randomly gets error for parameter - solution is to rebuild report...then it happens again

I am pretty experienced in SSRS, I have been doing it for quite some time so I know when I see the error:
"An error has occurred during report processing. (rsProcessingAborted)
An attempt was made to set a data set parameter '#SiteId' that is not defined in this data set. (rsUnknownDataSetParameter)"
I know what causes this error and can fix it. However, this error randomly happens every so often. What I end up doing is simply rebuilding the project and redeploying it and all is well for a few days, then suddenly again this same error will pop up again.
I know there is no issue with the parameter as I have a #SiteId parameter as shown:
So when I get an email from a user that "The Report Is Down" I just go to my report and rebuild and republish and the error vanishes without ANY other changes. A few days later when they want to run the report again this same error happens. What is causing this issue to come back over and over. We are running SQL Server 2016 with SSRS. It happens to ANY one of my reports on the report server. Its not a specific project it randomly happens on any project.
EDIT
What I did notice does happen is when a user reports this issue I go to the "Manage" of a report on the report server url. This area is where you find the properties, data sources, and parameters. When I click parameters I see this error:
So obviously something is destroying the parameters - that is where I am confused what is causing that. This is probably why I am getting the error message. So to reiterate a report is published works...suddenly the parameters go missing. User reports "the report no longer works" I rebuild and redeploy the report...it then works again for a day or so maybe more than a day I never investigated how long it takes for it to break again (as these are not urgent reports). Days later user says report is dead again...if I go to the report server using the report server url and click "Manage" and then click "Parameters" for some reason the parameters have disappeared...causing me to yet again redeploy. This happens over and over and over. It never ends...
The short of it is you cannot have the same shared dataset name across different SSRS Projects that are on the same SSRS server.
So within our SSRS "repository" we have several different SSRS projects. Both projects are very specific to certain functionality. What I noticed is everytime I deployed one of these SSRS projects the reports on the other project would stop working.
When the email would come from the user stating Application A's reports werent working I'd go to Application A's SSRS project and redeploy it and it would fix the issue. Days later a different user said Application B's reports weren't working so I would redeploy application B's. Not knowing that when I deployed A's reports B's would break, and vice versa deploying B's broke A's.
Come to find out....both projects had a shared dataset with the SAME NAME (dsEmployees). Same name however these datasets pointed to different sprocs with different parameters. Well when you deploy and look at the back end db the Catalog table only has one entry for dsEmployees. Everytime I redeployed this would overwrite with the other dataset since the names were the same.
Lesson learned across different SSRS projects be careful with the shared dataset name, they must be different. I was able to spot the difference by running the following query:
SELECT
c.Name,
c2.*,
c2.Parameter
FROM
DataSets d
INNER JOIN
[Catalog] c
ON
c.ItemID = d.ItemID
INNER JOIN
[Catalog] c2
ON
c2.ItemID = d.LinkID
WHERE
--one specific report for now
d.ItemID='C3008EF4-E544-48F3-92C1-2222C6148B13'
When the report was stated not to work. Then I would redeploy the report and rerun that sql statement I wrote and dumped the rows to an excel sheet to compare. One of those columns is Parameters and I noticed the parameters were slightly different. Immediately I was onto something and this ended up being it. Thanks to comment posted it helped me relook at this! This has bugged me for years!

Strange issue in SSRS 2016. I am unable to select parameters or run the report intermittently, it works fine most of the time

I am having a strange issue with SSRS 2016. We setup a new server and uploaded some reports, the reports ran fine for few days. The issue is, randomly the report doesnt run, When I load the report page, the parameters appear blank and I am unable to select any parameters. If I try to run and click the view reports button, nothing happens. After few mins/hours, it automatically resolves.
We have contacted MS support and could not get anything to get this resolved
Has Anybody faced a similar issue ?
This does not constitute an answer but it won't fit in a comment!
Does this affect more than one report?
If more than one, do they all fail at the same time or will one work and another not when you try to run the at the same time?
If the situation is "all fail" or "all work" at any single point in time then try adding a new report with no parameters.
If this attempts to run when other reports fail then it sounds like the datasource cannot be resolved or a timeout connecting to the database.
If your parameters are populated by querying the database the report will 'hang' until it can complete the queries to populate the parameters so by running a parameter-less report you should see an error instead.
Try running a trace on the database server to see if you can see the queries being run at all.
A bit vague I know but it might help you understand where the problem lies a little better.

SSRS Report Subscription emails stopped sending

Our reports in SSRS stopped sending. The last report was sent 2 days ago, and was send successfully, but since then none of the reports are being sent.
If I look at the SSRS web page for each report, there is no error. Simply showing the last run time as 2 days ago, so seems it didn't even try send.
Yesterday we did make some changes. But only moving a database from the Express version, to the regular version. We did not do anything that would affect the SSRS metadata (or at least we don't think we did...)
Where should we start looking to see why the report subscriptions stopped? Is there a process that could have accidentally been disabled? Thank you!
The Report subscriptions are created as jobs for the SQL Agent. You should see a long list of jobs with GUIDs as the names. Make sure that the SQL agent jobs are running. Going through the Steps of the SQL Reporting Services Configuration tool will recreate these jobs if you were to move the Reporting Service installation to another server. (I don't recall which step recreates the subscriptions. Just go through each pane and click "Apply.")
Depending on how you move things, you may need to backup and restore encryption keys, and you can easily end up in a state where two copies of subscription exist and are executed ( on different servers.) But in your case, where you didn't move SSRS, I'd look at the SQL Agent properties on the original server (Express) to see that the SQL agent is enabled and running, and check the history of the SQL Agent jobs, to see if there are any problems.

SSRS 2008 R2 Repeat One-Time Subscription

I am wanting to create a one-time SSRS shared schedule that can be altered once run, to execute again at a future point in time. The reason I am having to set-up a subscription in this way is because I need to email a set of reports based on a bespoke accounting calendar; we don't have enterprise so data-driven is not an option.
I have tested this method in the ReportServer.dbo.Subscription and Schedule tables, but have so far not managed to get it to work. I have updated the NextRunTime and StartTime columns of the Schedule table to the time I require the reports to be sent, and this appears to update on the Report Server Shared Schedules page (Next Run) but the email does not send.
Is there another table on the ReportServer database that I need to update, or is this simply not possible?
Thanks
Andy
I suggest taking a look at the article below. It details how to set up data driven subscriptions on SQL Server Standard Edition, and goes through manually activating subscriptions via SQL Server Agent.
http://www.sqlservercentral.com/articles/Development/datadrivensubscriptions/2432/
I've used if for a couple of clients and it generally works pretty well. The only thing I've since altered is increasing the timer to 10 seconds between running each data driven report.
Regards,
Jason
In reading up on this, messing abound in the tables is not supported by Microsoft. USE AT YOUR OWN RISK!
I attempted the very same thing. When you change a subscription on the front end, the ReportServer.dbo.Schedule.StartDate column changes with each edit. I tried just altering this value, but adding a value here made no difference. There was no email and when I went back to my subscription in the SSRS webpage, the original datetime value was there. So that datetime must be stored elsewhere.
I did a SQL Trace and found these Sproc's were being called. I copied out the lines that looked promising. By changing the time value #active_start_time=160400 in the last one and running the entire batch, I could get an emailed report at the desired time. But I am not content with this; because when I go back and view My Subscriptions webpage, the original datetime is still listed.
exec msdb.dbo.sp_delete_job #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD'
exec msdb.dbo.sp_add_job #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#description=N'This job is owned by a report server process. Modifying this job could result in database incompatibilities. Use Report Manager or Management Studio to update this job.',#category_id=101
exec msdb.dbo.sp_add_jobserver #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#server_name =N'(LOCAL)'
exec msdb.dbo.sp_add_jobstep #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#step_name=N'D478A346-ED05-422D-A73E-023080AD56DD_step_1',#command=N'exec [ReportServer$instanceDB].dbo.AddEvent #EventType=''TimedSubscription'', #EventData=''db7d7b08-3eee-4bb8-b354-b58c653b8ab6'''
exec msdb.dbo.sp_add_jobschedule #job_name=N'D478A346-ED05-422D-A73E-023080AD56DD',#name=N'Schedule_1',#freq_type=1,#active_start_date=20180405,#active_start_time=160400,#freq_subday_type=1

MS Reporting Services - Slow Reports

I created an annonymous SSRS web wrapper that had been working without error for several months. Recently we've had our year end release and the production version has had problems with, to my knowledge, one report. The Dev and Test environment produce the report without error it's just production where it has been failing. We've began to trouble shoot the problem with the following results:
The execution time for the stored procedure can at times be in seconds and other times in excess of 20 minutes.
The above is also true for rendering the report using report manager.
Once you get to the SSRS wrapper it completely fails. Even so considering there is a fluctuation in the amount of time the stored procedure executes it seems to me that even if I set the wrapper to not have a timeout the stored procedure may still be the culprit.
As for the report server, I'm not the DBA so I'm not familiar with the rs.config files. Also, I read something about the settings being set a certain way using IIS 6. According to the DBA it does not run off of IIS 6. Again, this is something I'm not familiar with.
Another thing I have a question about is parameter sniffing. There are three parameters being sent in, one for the City set as Text in RB 3.0 and Varchar in SQL, the month and year both set as int in RB 3.0 as well as integer in sql.
I know for a fact that the first time this error came about the server was reset and the report was produced without error. Since then they have been able to stabilize the server but now the report does not render. Anyone with trouble shooting advice please come to the rescue.
I have a negative one. Sorry about the bad question. Anyway, the problem was the stored procedure. The DBA told me he had to reset the statistics.