Print List - multiple columns

What’s the easiest way to print out a list of names and phone numbers from a database using the same field names, but in multiple columns. (alphabetical) ex:

John Doe xxx-xxx-xxxx Carol Jones xxx-xxx-xxxx

Jane Doe xxx-xxx-xxxx Bob Smith xxx-xxx-xxxx

Subject: RE: Print List - multiple columns

As a user, or as a developer (i.e. do you just want to do this once, or automate the task)?

To do it once, you could select the documents in a view and “edit/copy as table”. Then create a new document with a rich text field in it, and paste that in, delete any excess columns, then cut and paste portions of the table nested inside of another table.

To program it, I can’t think of any really easy way. To make them line up you’d need a table, which you can create via NotesRichTextItem and NotesRichTextTable classes. You can use the NotesRichTextNavigator to position the insertion point and fill in the cells.

Or I suppose you could use pass-thru HTML to arrange some lookup results:

_cols := 2;

_rows := @Integer((@Count(names) + _cols-1) / _cols);

_result := “”;

@For(_r := 1; _r <= _rows; _r:=_r+1;

_result := _result + "<TR>";

@For(_c := 1; _c <= _cols; _c:=_c+1;

	_i := _r + (_c-1)*_rows;

	_result := _result + "<TD>" + @If(_i > @Count(names); "</TD><TD>"; names[_i] + "</TD><TD>" + numbers[_i]) + "</TD>"

);

_result := _result + "</TR>"

);

_t := @If(_result = “”; “No data!”; “

” + _result + “
”);

@IfError(_t; @Text(_t))

Subject: RE: Print List - multiple columns

Thank you for your input. I’ll look over your suggestions. This is not a one time task. I want to put the phone info in a database for users to access and give them a way to print it out if they prefer.