Commenting SSRS

I asked the Twittersphere, “Anybody have a decent way to document SSRS packages inside the package? Aside from <!—-> comments in the XML code, of course.”  And all I got back were crickets. Same thing on a Google search: nothing much there.

So okay, there doesn’t appear to be a simple way to document your SSRS packages internally. We don’t have annotations, like in SSIS, or obvious comments, like in T-SQL code.  But we’ve all watched the Code Sins session, and we know how important documentation is, because memory is poor and jobs are short.  Now what?

You’ve got two things going for you.  First off, your SSRS report is just an XML file. You can view the code by going to View > Code on the toolbar.  That means you can also comment your report internally, to your little heart’s content, using the standard <!– –> code tags.

The rule is that you can’t include your comment inside any XML tags, and your comment can’t be the first line in your code. SO your only option is to start your comment tag at the very end of the XML code, after the closing </Report> tag.  AND, you can’t include the SQL comment characters

within the comment tags.  This will trip you up if you tend to put TSQL code (with comments) in your annotations, like I do. I just switch to using the multiline TSQL comment marker /* */, when necessary.

Another place you can comment is within expressions. This of course is very specific – you really only want to comment on the expression at hand.  Here you’ll use the standard VB comment marker, the single quote: ‘

I know, I know, these solutions are a little bit kludgy.  But if you’re like me, your reports could benefit greatly from a little internal documentation. Who knows? Maybe we’ll start a fad.

Happy days,

Jen McCown

One thought on “Commenting SSRS”

Leave a Reply

Your email address will not be published. Required fields are marked *