views:

1247

answers:

1

I'm using some complicated expressions in Reporting Services to control the value, format etc of data in a report (see MSDN).

Is it possible to insert code comments into these expressions, and if so, what is the syntax?

By code comments I mean something like:

// single line comment
/* or multi line comment */
+1  A: 

It looks like VB Code.
Try using apostrophe to write a comment.

'This is a sample comment.

This is a guess :)

EDIT: VB doesn't really have multiline comment.
However, try using the following to see if it works


'This is a sample comment _
followed by a new line _
and the comment ends

If that doesn't work, you could do


'This is a sample comment
'followed by a new line
'and the comment ends

EDIT2: Also, it seems that comment can be in the start or end.
source: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=441283

shahkalpesh
Thanks :) I tried it out. That syntax seems to work at the end of an expression only - which makes sense from your link, there's no way to comment mid expression, as its processed as one line.If I use it at the start of an expression, the expression code becomes report output, not good!
Sophia
hmm. Does the multiline comment work as expected (using underscore)?
shahkalpesh
It isn't actually necessary, as all lines after the first ' are treated as part of the comment. Code highlighting doesn't recognise the extra lines (with or without the underscore) though.
Sophia