TFS reports finds wrong project after rename - reporting-services

The problem is that alle the reports for a given project is now looking at a wrong team project.
In the standard reports the following query is used to determine the project:
SELECT TOP 1 p.ProjectNodeGUID, p.ProjectNodeName FROM
(
SELECT ProjectNodeGUID, ProjectNodeName, 1 AS RowRank FROM GetProjectNodeInfoFromReportFolder(#ReportPath)
UNION
SELECT '00000000-0000-0000-0000-000000000000' AS ProjectNodeGUID, 'missing' AS ProjectNodeName, 0 AS RowRank
) p ORDER BY p.RowRank DESC
But it does not return the correct one.
What has happened is that I renamed a project from A to A.Old and created a new project called A.
Looking at the report server, there is no folder called A.Old, only A but that actually points to A.Old.
Any idea of how to fix that?

If you are connecting to the Warehouse for TFS then you will need to run a rebuild of the Warehouse to have this change passed through. This is true for Project Renames, Deletes, and Collection detach/attach.
This should have been displayed in the warning message when you did the rename.
Running a rebuild from the admin console will fix this...

Related

SSRS - Trying to find all User Reports tied to a Batch File / Subscriptions

I have tried various queries I have found to try and accomplish this and none of them seem to list all the batch file/subscription instances tied to a user report in SSRS. If there is already a batch file out there tied to a user report, that's what I want to use versus creating a new batch file. I have tried going through the tables in the ReportServer database and looking for records to link to try and find this information, but I have been unsuccessful. Sorry if this is a simplistic question, but I have spent a few days trying to figure this out. Thank you!
You should be able to get at all subscriptions on your report server by running the following query:
You can alter this to suit your needs
use [ReportServer]
SELECT
R.Name
, L.TimeDataRetrieval
,L.TimeProcessing
,L.TimeRendering
, L.TimeDataRetrieval+L.TimeProcessing+L.TimeRendering AS TotalTime
,L.Format
,L.[Parameters]
,L.username
,L.TimeStart
,L.TimeEnd
,l.ReportID
,DATEDIFF(SECOND,L.timestart,L.timeend) time_seconds
,r.Path
FROM dbo.ExecutionLog L
INNER JOIN dbo.Catalog R
ON L.ReportID = R.ItemID
WHERE
R.Name like 'name of your report'

SSRS When uploading report owner name is wrong

I have SQL 2014 professional version 12.0.5000.0 with SSRS runing. eI have created a report in report builder 3.0 which works and runs find.
However when I go to create a subscription and run I get the user a1234 (as a example ) don't exist.
I looked there is no user with that name added to SSRS or in our domain.
my user name is ah1234 (as a example )
I looked in the subscription table and the owner is me ? However, the subscription is showing the owner as a1234?
I checked the report I uploaded it says the owner is a1234.
I'm thinking it might be a active directory issue but not sure.
Has anyone has see this before if so how can I fix the owner name of the subscription?
I don't know how SSRS has corrupted the owner name but here is a trick (written on 2008 R2) to correct owner names (I use this when people leave & their Active Directory user id gets deleted leaving orphaned subs that will not run).
Note that it updates the Microsoft-supplied subscriptions table, you may not wish to do that.
First identify the SSRS owner id for the from-person & also that of the to-person (you may need to get the to-person to create a subscription first):
SELECT distinct [OwnerID], u.username
FROM [<ssrs-database>].[dbo].[Subscriptions] s
join [<ssrs-database>].[dbo].[Users] u on s.ownerid = u.userid
Now make a safe copy of the subscriptions list, e.g.:
SELECT * into temp.subscriptionscpy
FROM [<ssrs-database>].[dbo].[Subscriptions] s
Now make the change, e.g. (this one changes the owner of all relevant subs):
update [<ssrs-database>].[dbo].[Subscriptions]
set ownerid = 'DDD87598-8957-42C8-8DBC-A893E7174CB6'
where ownerid = 'EBF0E483-69E6-4458-B171-BA28FFCCDF3F'
Now check the owner is as you want it.

CRM2011 Filtered Views and Reporting Services

I have a strange problem, I am trying to use reports within dynamics, I have created a query that runs agains the Filtered Views:
SELECT TOP 10 Activity.ActivityOn, Activity.Name, Activity.activitytypecodename, Activity.subject, Activity.owneridname, Activity.createdon FROM (
SELECT 'Project' as ActivityOn, project.new_name AS Name, activitytypecodename, subject, activity.description, activity.owneridname, activity.createdon FROM dbo.Filterednew_project project
JOIN dbo.FilteredActivityPointer activity on project.new_projectid = activity.regardingobjectid
WHERE project.new_projectid = #ProjectId AND (NOT activity.statecode = 2)) Activity ORDER BY Activity.createdon DESC
However when I try to run the report that uses this in Dynamics, no rows are returned (I am logged in as myself, with full sys admin privilages.) Yet, when I run it on SSRS (through /reports) then it returns rows. (this is also running as myself.)
Does anyone have any ideas of what is wrong? (There are no errors, it just fails to return data in dynamics.)

How to specify the report pdf name at run time?

I have a report named "Debt Report ". It runs for every month and a pdf is generated at the first of the month by subscription option.
If I am running the report for the month then the report name of the pdf should be "Debt Report for April" and like wise if I run it for may then the name of the pdf should be "Debt Report for May".
How can I do this?
Assuming you are scheduling the report to a file share, you can set the name of the file share to be Debt Report for #timestamp - this will name the file in the format Debt Report for YYYY_MM_DD_HRMINSS .
If you only want the month name (not the entire timestamp) to appear in the filename, you will need to use a Data Driven Subscription.
Another option, although a bit more technical, is to use the rs.exe utility to generate the report. This involves:
creating a script file that generates the report (this is where you can set the filename to your preference)
creating a batch file that calls rs.exe with the script file as a parameter
running the batch file on a schedule e.g. with Windows scheduler or SQL Server Agent
There is an example here of how to do this (to create Excel files but the principle is the same) http://skamie.wordpress.com/2010/08/11/using-rs-exe-to-render-ssrs-reports/
The solution for this problem is "Data Driven Subscription"
http://msdn.microsoft.com/en-us/library/ms169972(v=sql.105).aspx
http://www.kodyaz.com/reporting-services/create-data-driven-subscription-in-sql-server.aspx
the following link helped me alot but the query given in the link creates trouble- cast the datatype of the getdate and it will solve the problem
http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/0f075d9b-52f5-4a92-8570-43bbdaf2b2b1
I have had to do the same thing ( well almost )
I had to generate a weekly report to file and save it as REPORT-Week01.pdf, then REPORT-Week02.pdf etc.
The mechanism I used was to change the parameter column in the Schedule table via a scheduled job. This computed the required file name and simply replaced it. Then when the scheduled job runs, it writes to the file name setup when the schedule was created ( except that was changed at 1 minute past midnight to what I wanted it to be )
I have since implemeted another set of reports that write to a folder, whihc changes each month the the next months folder name ( currently writing all reports to a folder called 202103 ) tonight the job will run and the output folder will change to 202104 and the scheduled jobs will never need changing

Get files for deployed Reports

Is it possible to get the files for a deployed reports ON SSRS 2005?
On of our developers deployed them to the Reporting Server, but didn't commited his changes to SVN. Now we are in an inconsistent state and we also can't find the files he created.
In Report Manager (usually the URL ends with /Reports or /Reports_instanceName ) You can look at the details of reports. The Edit button will allow you to download the .rdl definition files.
From
http://msdn.microsoft.com/en-us/library/ms156032(v=sql.90).aspx
In the Report Definition section, click Edit to extract a copy of the report definition. Modifications that you make locally to the report definition are not saved on the report server.
(I should have also noted, the interface and the button name change in SSRS 2008, so these instructions are specific to SSRS 2005.)
use ReportServer
go
create view vwReportDataSet_SharedDataSet_Mapping
as
select ds.itemid, ds.name as Report_DataSource,
cat.name as Shared_DataSource
from datasets ds
inner join catalog cat on ds.linkid = cat.itemid
go
create view vwSharedDataset_Usage
as
select cat.path,
cat.name,
cat.type,
ds.Report_DataSource,
ds.Shared_DataSource
from
catalog cat
left join vwReportDataSet_SharedDataSet_Mapping ds
on cat.itemid = ds.itemid
This SQL gives you your report dataset usage.
select * from vwSharedDataset_Usage
where type = 2
and path like '/SIT/%'
and name in ('Report1','Report2')