Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

Auto-Numbering in SSRS

Hi Experts!

I have a report and I want it auto-numbered each time a report is created. Would I need a column in a table to that? Could the report form number be at the report level?
0
December2000
Asked:
December2000
2 Solutions
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
My guess is the only way you'd be able to pull this off is something like...

(1)  Have as one of your data sets a stored proc that returns a version_number
(2)  Create a table somewhere that holds the number of times the report has been run.
       { an excellent start for logging report metrics btw }
(3)  Have the SP extract the above'number of times the report has been run', UPDATE it to incriment it by one, then return the extracted number in the SP.
(4)  Have a textbox somewhere who's data set is the SP's return value.

Good luck.
Jim
0
 
Simone BCommented:
The information you're looking for is in the ReportServer database:

SELECT B.Name, COUNT(A.TimeStart) FROM ExecutionLog A
INNER JOIN [Catalog] B ON A.ReportID = b.ItemID
WHERE b.Name = 'YourReportNameHere'
GROUP BY b.Name

If you have more than one report with the same name, you could use Path instead of Name for uniqueness.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now