Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

I apologize for the long break between posts. We're up against a deadline for version 8.0 and hurrying to fix as many bugs as we can.

Here's a freebie to make up for it. It's nothing too fancy, just a little class for creating rich-text reports and displaying them in a few different ways. It includes code to deal with the problem of paragraphs getting too long, and conversely, the problem of having too many paragraphs. Basically, when you want to have a line break in your report, the class only starts a new paragraph if you specify it has to. Otherwise it uses line break, unless the paragraph is getting too long, in which case it starts a new paragraph.

Or to put it more succinctly, you get the longest possible report (functionality!) with the smallest possible number of paragraphs (performance!).

It's too bad we can't use this class for the design synopsis...

I'm going to build on this with more useful stuff in the coming days, so stay tuned.

Andre Guirard | 15 June 2007 02:28:32 PM ET | Plymouth, MN, USA | Comments (4)


1) I think I have a use for this
Slawek Rogulski | 6/19/2007 12:13:39 AM

I can see myself extending this code, or repurposing the report creation code to use rich text as a way to store large numbers (million+) of records.

2) rich text is odd
Slawek Rogulski | 6/19/2007 6:16:33 AM

I have been playing around with the code and it seems liek the results I am getting are a bit strange. I set PARLIMIT = 128000 and all is well. The document might take a little longer to open but I thought it would have come up with an error with anything above ~32000. I read that the maximum number of paragraphs in a document is >20000 but I was only able to add ~300 paragraphs. I will keep teasing the code and see what pops out.

3) re: rich text is odd
Andre Guirard | 6/19/2007 9:19:21 AM

I set PARLIMIT = 128000 and all is well.

I'm assuming this has not changed... the paragraph length limit is based on the number of bytes, not the number of characters, and non-ASCII characters take multiple bytes. When you reach the limit, there is not an error, but Notes will insert a paragraph break for you, and it might not be where you would prefer to have it. By keeping count ourselves, I'm hoping to avoid involuntary paragraph breaks.

4) Code Sample
Rob Axelrod | 6/19/2007 11:10:30 AM

This will be great since I do similar stuff in many of my apps but this is way better.

BTW, great reference to W. Kotzwinkle's Dorky Day chapter of "The Fan Man" in the code sample (I assume this wasn't accidental)

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact