October 31, 2007

Problem printing rich text fields

If you have a rich text field that contains a fair amount of information it will print nicely, but when it exceeds a certain amount of information each text paragraph will be printed on a separate page which causes a printout that normally would be of two pages to turn up on 40-50 pages. Really annoying and a waste of trees!

The solution to this problem is to enclose the rich text field in a table which compresses the content in the rich text field and prints nicely.

While testing, look at the print preview which shows the same result as the actual printing.

Technorati tags:
, , , ,


2 comments:

Kevin Pettitt said...

I wasn't aware of this problem, but I am aware of a related issue that may or may not make your solution untenable. The problem is that while rich text fields can include layout regions, tables cannot. 99.9% of the time this is probably a non-issue, but here's an example to illustrate how it might become a problem:

Let's say you have a Notes environment that was setup in the 4.6 or earlier time frame. In Notes 4.6 the mail template used layout regions on the form in the header area. Now, let's say you have an old email thread where one of these layout regions is now included in the reply of a message (i.e. in the rich text body field). If you were to copy that body content and paste it into another rich text field that was inside a table, it won't let you.

It's been a while since I've seen this so it's *possible* that the problem no longer applies in v7 or 8, but its worth testing if you have any potential for this scenario or something similar.

Kevin
www.lotusguru.com

Dan J said...

Just wanted to thank you Nick!
You've given me a solution to a problem that I'd spent over 2 hours trying to solve. I'd tried every permutation and was doubting my code. And the whole time it was an issue with the printing of rich text fields!

Thanks for documenting this - that is what the internet is really for.

Best Regards, Dan