One of our reports tells the folks in the warehouse when we show a negative inventory on hand. Most likely it is because someone did an inventory adjustment while not realizing that the product was just misplaced, or at someone's desk for demonstrative purposes. It happens, deal with it, move on. That said, no one wants to have to go looking to see what happened, and do another inventory adjustment. It's much easier to pass the buck or pretend you didn't see the email.
Which brings us to our trusty event manager. So, I could do an absolutely beautiful report in Crystal with lots of color and information. But then it would get sent as an attachment. Does anyone really think that the warehouse crew will happily open that attachment every day? Most likely not. So, I have the information in the body of the email instead, so that it pops right up for them. Some of them even have their work email sent to their phone, so I know they can see it without having to download a PDF viewer.
Did you forget all of your high school / early college HTML classes? I hope not, because that is what Event Manager uses to pretty up your email notifications.
Now my boss doesn't readily understand the differences between HTML and Crystal, so something that is easy to do in Crystal, isn't necessarily so easy to do in HTML. One of which is changing the formatting based on the data.
In order to do this, I created a calculated field in my Query Definition. I then wrote it do return a <B> tag in the desired condition.
In the body of the email, I put the tag in the place where a <B> may or may not go and write in a </B> tag to close it regardless of whether it is there or not. Voila, conditional formatting!
This example was something easy, just making something bold. But the same principle could be used to other things also. Just remember you might need to do the computation twice to make an open tag and a closed tag, depending on what type of formatting you are trying to do.
No comments:
Post a Comment