
Laim McKenzie asked a question.
Custom Report via Stored Procedure
Hi,
I used to have a script saved that showed how to do custom reports via stored procedures, but as I rarely use that method I seem to have lost it.
Does anyone have an example of a custom report that executes a stored procedure?
Laim
Hi Liam,
I have asked the same question to Snow and they told me that the article is still there but in a section that we cannot access yet (I have apparently been given access but could not locate it yet)
We are using custom reports. What exactly are you looking for?
Hi Laim
I'm not sure if this answers it but my old post about creating custom reports can still be found on here -
https://community.flexera.com/s/question/0D51r00008OrDgkCAF/slm-user-audit-custom-report
Although the links via google don't obviously work anymore on here, the search function does seem to pick up legacy posts.....
Adam
Hi Adam, maybe you know how to restrict data visibility by user running this report?
Hey Andash,
You can do it by doing UserID = X
Where X is the users UserID
If you're on an SPE you can do where CID = {0} and it will show only that customers data as well
Laim
All users should be able to view this report, but it should show only data available to them due organisation restrictions.
Thanks for quick answer.
UserID need to be dynamic, not hardcoded in report due different users viewing the report will have different UserID's.
Are you wanting it so only specific users can view the report, or so everyone can view the report?
If you want everyone to view the report you don't need to define UserID at all, if you just want specific users you would need to do where UserID IN (0,0,0,0) etc
The other (messy) option is to make a custom admin role and just assign the users by that way, but it's a pain to maintain
Ah ok that makes more sense. You'll want to join in with tblSystemUserOrgDefinition, something like this
FROM [dbo].[tblComputer] ci
INNER JOIN [dbo].[tblSystemUserOrgDefinition] uod
ON uod.CID = tc.CID
AND UOD.UserID = {1}
AND UOD.OrgCheckSum = ci.OrgCheckSum
LEFT JOIN [dbo].[tblOrganization] o
ON o.OrgChecksum = ci.OrgChecksum
Great, thats what i need, thanks!