Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comment out code in an expression? 3

Status
Not open for further replies.
Dec 27, 2007
56
US
We tried a number of things Friday in a class and nothing seemed to work. Surely it can be done?
 
not in 2000 - maybe 2005 where the editor is better but why have code in an expression?

Code goes in the code window and then you call the function from the expression window so I don't see why you would need to comment out in the expression window...

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks, that's a concept that was not introduced by our expensive microsoft partner consultant/trainer. He had us writing iif statements in the expression to shade alternate rows in a group, and they didn't work. When they didn't work, he moved on. I wanted to save them commented out so I could look them over on my own time without bombing out the report meanwhile...I'll find some reading on your suggestion.
 
right - gotcha

I don't define IIF statements as code - they're just formulae really

Because they are not defined as code, there is no real reason to have a "comment out" functionality (which there is in the code window)

For your particular situation, I would either copy the IIF statement to Notepad or save a seperate copy of the report with the IIF statements still intact

Alternatively, you can just remove the "=" and it will be treated as a text label

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks, I appreciate your response. I'm transitioning from Crystal Reports, where I frequently comment out formulae in the expression builder with notes like: "removed per user 7/1/2007" because they change their minds frequently - after they've forgotten they asked for the change! [noevil]
 
too true, too true. I tend to keep notes in my diary for that or ask them to send the request on email so I have a copy of it.

AFAIK, there is no functionality to do that in RS

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Diet Squirt

I use ' for commenting out code and putting notes in an expression. You will find the code will turn green.

The expression works ok, but in layout view the comments will show. Probably a bug

It works best putting comments after the expression

e.g

="Report Run Time: " + format(Globals!ExecutionTime, "dd/MM/yyyy")

' Shows the date report is run

Regards
Mark

 
xxing - you learn something every day !!

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Mark,
Thanks for the tip, I knew that commenting out the expression with a tick would display the expression as text, but I didn't realize you can insert a comment after the expression.

Don't know what inspired me, but I just tried this (because I want to hide an expression yet keep it there)and it displays an empty cell just like I want. It's an extra step over what Crystal allows, but oh, well.

=NOTHING
'=First(Fields!CurrentFiscalYear.Value)
'TEST COMMENT blah blah blah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top