Job ID owned by SSRS cannot match any Subscriptions on SSRS - ssrs-2008

I got a problem when I try to identify SQL Agent job that runs a Reporting Services subscription. However, I found there are a few Jobs owned by SSRS cannot match any Subscription. For instance, I have 16 jobs in job agent, but I only could identify 13 of them.
Does anyone have any ideas about this situation? Is there any way to figure it out where the unexpected job come from and trace them?
Appreciate it!!

It takes a bit of footwork, but you can figure this all out by looking in the ReportServer database that you specified at install time or in the SSRS Configuration tool.
The key tables you want to look at is reportSchedule and Subscriptions. Both will create jobs in your SQL Server Agent. The ScheduleID should match the job name. You can match ReportID with ItemID in the Catalog table to get the name of the report.
Here a query you can run to get more info on subscriptions. I made this into a report in SSRS that I review daily. Note: I probably ripped this off from another StackOverflow answer.
select c.Name,s.LastRunTime,s.LastStatus,s.Description,s.ScheduleID
from ReportServer.dbo.Subscriptions as s
left join ReportServer.dbo.Catalog as c
on c.ItemID=s.Report_OID order by LastRunTime desc

Related

In SSMS is there a way to export a list of job steps in a SQL Server Agent job?

In SSMS is there a way to export a list of job steps in a SQL Server Agent job?
The reason I'm asking is that I've been asked to organize a long list of job steps placed in three different jobs. This is something I'd like to share with my team in an Excel document so that we can make notes, demonstrate grouping and sorting ideas, argue about it, etc.
Is there a way I can export this list, or at least print it? I could do a screenshot, except that the list extends past the screen? I'm not looking forward to keying this by hand into Excel.
Thank you for any ideas.
You can query the server;
select
job.name,
steps.step_id,
steps.step_name,
steps.command
from MSDB.dbo.SysJobs job
inner join MSDB.dbo.SysJobSteps steps on steps.Job_Id = job.Job_Id
where job.enabled = 1
order by 1, 2

Finding Records if a field is used more than once in crystal report

I am just trying to create a report that will give me the Job Numbers if the same address is being used for multiple Jobs.
E.g. if Jobs J1,J2 have same information for the field Job Address, I just need to pull those two Records.
Grouping by job Number helps but it also gives the valid Jobs which have the distinct Job Address.
Any help will be much appreciated . :)))

Displaying a custom error from SSRS Report Manager for rsProcessingAborted

I'm using SQL Server 2008 R2 Reporting Services, designing reports with Report Builder 3.0 and viewing them through Report Manager (http://host/Reports/, not http://host/reportserver/).
I have a large number of reports built and accessed this way, reading data from a database which is refreshed every hour. The refresh process takes a few minutes and is a simple ETL C# script I wrote to (for each table) delete all matching rows and insert new data (inside a Transaction). It might be this part of the process I need to change, so I have tagged this question with SQL Server 2008 R2.
My issue is that whenever the import and SSRS report execution run simultaneously, I get an rsProcessingAborted error. It looks like processing aborts if the underlying data changes while it is executing. One of my reports is very complicated takes several minutes to run, so I see this error a lot and generally don't see it at all on the other reports.
An error has occurred during report processing. (rsProcessingAborted)
Cannot read the next data row for the dataset xxx. (rsErrorReadingNextDataRow)
These reports need to be shared with users who will not want to see the error. Is there any way I can
make my import script and the SSRS execution "atomic" so the report is able to run anyway
customise the rsProcessingAborted error shown in Report Manager so that the user is shown a message like "The data behind this report is being refreshed. Please try again in 5 minutes." - still irritating, but nicer than the error above...
Use "NOLOCK" table hint in your report.
For Example:
SELECT [LastName] FROM [dbo].[AuditLog] WITH (NOLOCK)

SSRS Dynamic Filenames for Email Subscriptions

We are in the process of migrating our reports from Crystal Reports to SSRS. In Crystal Reports we use variables to dynamically generate our filenames so when the report gets sent out via email, the file has the report name and execution date. (e.g. MonthlyReport09-07-2012.xls).
Is this possible in SSRS? I don't see any straightforward approach to using variables in the filename when subscribing to a report. This could prove troublesome when sending multiple reports with the same filename to the same person because it would be difficult to discern which report is which.
Any help is greatly appreciated. Thank you SO.
There is no feature in SSRS as such but there is a work around for this. You have two options
Option 1:
Instead of emailing it directly first dump the file in fileshare location which can be something like \machine-name\ExportReports\ReportName\ then create a windows job which renames the file to the format you want and emails it in the next step.
Option 2:
Refer to this blog what you want starts from section "Generate a PDF output file programmatically" now you can use this in an assembly then have some scheduling mechanism which picks up the schedule. This then calls the DLL which generates the report and emails it.
Use #timestamp in the name of the file and it will translate at run time.
You cannot specify the report filename in a standard subscription in Reporting Services.
If you have Enterprise edition (or SQL 2012 Business Intelligence edition) you can use the Data-Driven Subscriptions features that allows you to specify the report filename (and other properties) based on data retrieved from a table.
If you have Standard edition, then your options are either of the ones suggested by Bhupendra, or you could look at scripting the report generation using the "rs.exe" utility supplied with Reporting Services and use Database Mail and SQL Server Agent to handle the emailing and scheduling.
This post looks pretty old , but better late then never ...
There are some tools on the market , which can run SSRS reports : CRD, R-Tag and RemiWare
These are Desktop tools but I guess you are not looking to replace SSRS , just to extend it.
I am not sure about the CRD and RemiWare , but R-Tag supports data driven reports and dynamic names. It also can be used with Standard license.
I was able to automate the emailing and change the file name by looping thru a table of accounts, invoices and emails, then setting the parameters and renaming the reportname and pathname in catalog be execution at the end of the after the execution I did a wait for 2 seconds then when to the next loop. I the end I set the path and name back to orginalname. Performed well.
#timestamp works for Windows File Share as answered by Chris.
For Email deliveries, you could use:
#ReportName -specifies the name of the report.
#ExecutionTime - specifies when the report was executed.
For more details- MS Docs
You can do this by changing the filename directly from the table [ReportServer].[dbo].[Catalog]
Make sure to add a forward slash to the Path
For e.g. I created a SQL Job that ran every night before the report and added the date to the filename.
Sample Job (replace [ItemID] corresponding to your Report):
DECLARE #PREFIX CHAR(25) = 'REPORT_NAME_';
DECLARE #SUFFIX CHAR(8) = CONVERT(CHAR(8),GETDATE(),112);
DECLARE #VARNAME CHAR(33) = CONCAT(#PREFIX,#SUFFIX);
DECLARE #VARPATH CHAR(34) = CONCAT('/',#PREFIX,#SUFFIX);
UPDATE [ReportServer].[dbo].[Catalog]
SET
[Name] = #VARNAME,
[Path] = #VARPATH
WHERE [ItemID]='63D051EE-3139-4F50-ADBB-1C944F3D5D47';

CRM 2011 and SSRS - Generating a report for a single record

Is it at all possible using CRM 2011 and SSRS to generate a report on a single record, and only get results for that one record?
EDIT
Additional Info - Must Use:
Custom SSRS report
Custom entity in CRM
Here's a more specific link to your question: link. You're probably looking for pre-filtering (look for "3. Pre-filtering Element" in the link provided) if you want the report to be record specific (context sensitive).
Here's a link describing the 2 types of pre-filters (CRM 4.0 but the theory applies to CRM 2011): link. And here's an example of prefiltering in CRM 2011: link
I have done this successfully in CRM 2011 with a completely custom report made in BIDS, on a custom entity, with full context sensitivity.
Make sure to learn fetchXML as it's going to be the going forward technology for these reports. The existing reports are using SQL which make them bad examples to copy off of.
Here's an example on how to extract fetchXML from an advanced find: link It also has more information on pre-filtering.
Take a look a the report Account Overview.rdl. It could be executed for a single account record or multiple records.
See Reporting for Microsoft Dynamics CRM Using Microsoft SQL Server Reporting Services
Create an embedded connection to the CRM database engine for the environment you want to target.
Create an embedded dataset to query the current record. This going to be kind of weird since experience will tell you that you are going to get tons of records, but because of the clunkiness behind CRM it will actually only get the current record. For example, if you wanted to get the current quote you would use "SELECT quoteid FROM FilteredQuote AS CRMAF_Quote"
Add a parameter to store the reference to the entity you just queried. In keeping with this example I created #QuoteFilter which is type text, could store multiple values (even though that's not what we're using it for), and gets its default value from the dataset in step 2. Also, probably ought to make this hidden since GUIDs aren't end user friendly.
Finally, use the parameter discovered in the where clause of the other datasets. For example, a search on quote products for the current quote would look something like SELECT * FROM FilteredQuoteDetail WHERE (quoteid = #QuoteFilter)
As a final note, you should keep in mind that CRM loves to remember everything even when you don't want it, too. On one of my reports I messed up my datasource and CRM was forever convinced that the report should run against all records. I fixed my datasource, but uploading the report did not trigger a refresh and correct the problem. In the end, I deleted the report from CRM, created a new one, uploaded the same exact file with no changes, and everything worked. Go figure.