logo

Using MIME-Based HTML Tables in Notes Client

I remember back when I first started with Notes development having to create tables on Notes Forms to display data held in fields in the same document. Maybe you did something similar whereby you'd use one multi-value field for each column of data and add a table to your form with one field in each column. Then you'd hope there was no wrapping. All very messy.

Having not done any real Notes development for 10+ years it's not something I've thought much about since. Until last week when I needed to display a table in the Notes client.

If I was in any doubt that my career is on a circular path then the fact I've just been developing for the Notes client can only confirm this.

Anyway, it turns out there was a better way of doing it, which worked quite well and I feel compelled to share, as it's not something I'd thought possible until I tried it.

The requirement I had was for tracking parcels using a courier's Web Services. Each "shipment" document in the Notes database has a tracking number in it. My job was to write a scheduled agent to regularly update the tracking data and mark documents as delivered or raise alerts for any issues.

I also needed to produce a visual way of displaying progress for each shipment, which ended up looking like this:

image

What you see above is just a standard Notes document opened in the Notes client. The table itself is standard HTML stored in a MIME-based field. All that my Java needed to do was build the table and stick it in a field. The fact I managed to make it look nice at the same time with a little CSS is an added bonus.

The data is purely for visual reference, so the fact the field can't be interrogated in any way isn't an issue. And, also, because the courier always returns all tracking data with each call to the service I can just delete and re-create the field and the table from scratch each time.

Job done. Remember, MIME is your friend.

Comments

  1. Nice work, Jake.

    It's not a circular path, it's demonstration of mastery.

    • avatar
    • Mike
    • Tue 20 Mar 2012 01:41 PM

    Good stuff ... I embarked on something similar recently but ran into a snag when needing to display icons in some columns. Since the table was being included in an email, the gifs needed to be attached to the message in the event the message was viewed offline.

      • avatar
      • Jake Howlett
      • Wed 21 Mar 2012 04:06 AM

      Did you overcome the snag Mike? It's easy enough to include inline images in MIME emails.

      Hide the rest of this thread

        • avatar
        • Mike
        • Wed 21 Mar 2012 11:07 AM

        No .. due to time constraints I went in another direction. Inline images are no problem, but it was my impression that the image file(s) needed to be attached to the message if the user was viewing it while not connected? If not then I'll have to take another look at that.

          • avatar
          • Jake Howlett
          • Wed 21 Mar 2012 11:19 AM

          That's right. For offline viewing you attach the image to the MIME field in base64 encoding and then you can refer to it directly from within your HTML by using an ID you assigned to the file while adding.

          It's not too hard to do. The hard part is getting it to work on all email clients. Last time I tried that I gave up in frustration at what appeared to be a bug in the way Notes handled multipart MIMEs.

    • avatar
    • Palmi
    • Wed 21 Mar 2012 01:08 AM

    Xpages developers : How easy is this in Xpages ? I can imagine its pretty easy.

      • avatar
      • Bill Hanson
      • Tue 1 May 2012 08:34 AM

      The process is the same for XPages, but it's overkill to use MIME when the browser already supports HTML. Also, repeat controls are normally more efficient (performance & memory) than generating, encoding, and displaying a long HTML string.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 20 Mar 2012

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content