Dynamic table help

I’m making some code changes to a pre-existing database that uses a spreadsheet in a form built from a dynamic table. (Only one spreadsheet is used in the entire database.) Users can click an ‘Add’ button to add entries to the table, and a new row is dynamically created as a result.

I need to be able to search the contents of the table using column criteria such as name, date, item #, etc. The problem I have is each column is actually defined by a field with multi values. For example, the Name column is a field called ‘column1’ with values such as MickeyMouse, Donald Duck, Goofy, etc.

Any suggestions on how to grab the values of each field and build a searchable view? Any help would be appreciated. Thanks.

Subject: RE: Dynamic table help

I think your mentioning a spreadsheet is just confusing the issue. Unless it is somehow relevant, forget about the spreadsheet.

The problem is: You want to do searching from a Notes view using a customized dialog, and the fields you want to search on are multivalued fields. There are several fields with the same number of entries, which you treat as a table, so all the first entries of each field constitute “row 1” of your data, all the second values are “row 2”, etc. For instance, the multivalued fields might be called Name and Number.

You want to create a dialog to search these documents, which will end up displaying only those documents that meet the criteria entered by the user. The user will enter a value for Name, and a value for Number, and wants to see only those documents that contain those values in the Name and Number fields, in the same position. E.g. if a document contains:

Name

Number

Mickey Mouse

7

Pluto

32

then if the query is Pluto and 7, you do not want to match this document. But if the query is Pluto and 32, you do want to match this document.

Is that correct?

It sounds like you want to display the results in a view. This may be difficult, since there is no way to do what you are asking for with a full-text query. You could construct a full-text search to locate some documents, but then you would have to iterate through these to find the ones where the matching data were on the same row. Having done this, you have a couple of choices for displaying the results: you could put them in a folder, or create a rich-text report containing doclinks.

There’s an article I wrote for The View that demonstrates answers to a similar problem (creating a collection based on a search that encompasses data not stored in the actual documents found). You can find this here .

Subject: RE: Dynamic table help

Um, actually the spreadsheet is relevant because the dynamic table actually produces a spreadsheet where each row consists of data that is relevant:

Name Item # Priority Status

Pluto 2006-10-17-32 High Complete

Goofy 2006-10-17-45 Medium Pending

However each column in the above table is single field that needless to say has multiple values. So, for example, in a view I would need to list Pluto as the name, and have the correlating data display either in the same view or in a document when opened. Any suggestions to this end would be appreciated. Thanks again.

Subject: RE: Dynamic table help

I think what’s confusing me is that you are not using the usual meanings of words.

…database that uses a spreadsheet in a form built from a dynamic table.

You are saying that something in your application builds a form. A form is a design element, and while you can certainly create one from program code, for instance using DXL, I don’t think that is what you meant. Actually, I think you mean that there is code that reads data from a spreadsheet. The code creates a single document that contains all the data read from the spreadsheet. Is that correct?

When you say “dynamic table,” I think you are talking about a table on a Notes form, which grows as you add data to it. It doesn’t make sense to me that you say that the form, or document, is “built from” a dynamic table. Do you mean that you have a form that contains a dynamic table? You can’t build something from a thing it contains, because to contain something, it has to already exist before the thing that built it exists. This is a paradox.

(Only one spreadsheet is used in the entire database.)

It sounds like you’re saying that the spreadsheet is stored in the database. I have to assume it’s a file attachment or embedded object in the one document. So this document contains two copies of the table information; one in the spreadsheet, and one in several multivalue fields which each represent one column.

Users can click an ‘Add’ button to add entries to the table, and a new row is dynamically created as a result.

The user adds a row of data to the “dynamic table” in the Notes form. The result of this is that a value is appended to each of the multivalue “column” fields, and this data is somehow displayed in tabular form. How this is done may be important to answering your question. You don’t mention whether the spreadsheet is also updated at this time.

…the spreadsheet is relevant because the dynamic table actually produces a spreadsheet where each row consists of data that is relevant:

I don’t understand what you mean when you say the dynamic table “produces” a spreadsheet. A dynamic table is not an active object – it is not program code. How can it produce a spreadsheet? Do you mean that the spreadsheet is your dynamic table? In other words, that the spreadsheet is an embedded OLE object which is used to display the data from the hidden multivalue column fields? So you don’t have a table at all, dynamic or otherwise; you have a spreadsheet instead of a table. A “table” is something specific in Notes. If it’s a spreadsheet, please don’t call it a table.

I need to be able to search the contents of the table using column criteria such as name, date, item #, etc. The problem I have is each column is actually defined by a field with multi values.

Usually, the hard part is not doing the search, but displaying the results. I suspect this is the problem in your case. If the hard part really is doing the searching, I don’t see why you consider it difficult. Write LotusScript code to iterate through the elements of your multivalue fields and see which ones match the search criteria.

Any suggestions on how to grab the values of each field and build a searchable view?

Now you are specifying that you want to do your searching in a view. Are you doing this because the requirement calls for you to use a view, or because you think that’s the only way to do searching? I see no reason you couldn’t create a form action that the user would click while this big document is open. The action could ask the user for the search criteria, and build a table of the results that it would display in a dialog box. No view is involved.

Or, you could use the spreadsheet object, if you have a spreadsheet object, and rearrange and highlight the rows to make it show only the matching rows, or to show them first and in a different color, or something. (Note, however, this would require the document to be in edit mode).

It’s kind of silly to create a view that contains only one document. You could do it, by setting one column to be sorted and display multiple values in separate rows, and setting the other columns to display multiple values in separate rows and not be sorted (this last point is very important, otherwise you get all the combinations of values in the fields, rather than having the rows match in the views). But the problem with searching a view that contains only one document repeated many times, is that the search looks at the contents of the document, not the contents of the view rows. So either all your rows would match the search, or none of them would. This is not very useful from the standpoint of the user, who probably wants to see just the matching rows.

You could produce such a view by having a separate set of column fields, which contain only the subset of rows that matches the query. You would have to assign these rows each time the user did a search. However, this requires making a change to the document each time you do a search, which is very likely to lead to replication/save conflicts due to different users trying to search at the same time or in different replicas.

If I’ve understood you correctly about how the application works, I feel it was not well designed. It doesn’t make sense to have a Notes application with only one document, that creates something that looks like a view instead of just using a view. There seems to be no reason it could not have been designed to make each “row” a separate document, which would make searching in a view very simple – also sorting, editing, adding rows, deleting rows, and so on. It sounds like this was designed by an ingenious fool – someone who’s way too clever for his own good, and has to do things his own way because it would be a challenging problem to implement, instead of doing it the normal and easy and sensible way.

Subject: Dynamic table help

First of all, it very much depends on amount of data that you need to have inside your document.

There is 64Kb limitation of text per document.

One of solutions includes MIDAS RichText solutions, others available in Sandbox - look for DynamicTable.

Using second solution - it just gives you multi-value field, so you can show it in view with “show multivalue as new entry” or such - won’t help you too much, and view would be very heavy…

Hope it helps,

Nahum

Nahum.

Subject: *Just to be clear, there is no 64KB limitation on a rich text field. You can have multiple MB if you like.

Subject: However, there is a 64KB limit per paragraph…

Richtext is limited to 1GB (based the limits Notes client help)…

and keep in mind that just because appears to be a line break doesn’t mean its a paragraph break…

Subject: RE: However, there is a 64KB limit per paragraph…

True. This is usually less of an issue with a dynamic table than with other dynamic rich text as each table cell is a separate paragraph, but it is well worth pointing out.

Subject: There is a 64KB limit per document…

Ben, Chuck…

Sorry to tell you, BUT there is an 64Kb of SUMMARY data per document.

You can easily do it yourself - create form with 10 text fields (as we have 16K of text per field limitation). Take 15K of text and put it in first field. Save document to see that you don’t overgo 16K limitation - it depends if you work double byte (most probably) or single byte.

Then copy all of the text from there to other fields and try saving document.

You will get error. It comes from 64Kb of summary data per document limitation.

To remind you, Rich Text is Non-Summary data.

Again, limitation on saving document only - not when document is open - so you can have fields coming to couple of MB in memory but only up to 64K of summary data in saved in document.

Nahum

Subject: RE: There is a 64KB limit per document…

Of course there is a limit of 64KB of SUMMARY data, but a dynamic table in a document is not going to be summary data because it is rich text, and as you yourself point out, rich text is NOT summary data. Otherwise, you are talking about a pseudo-dynamic table done on a form, which is a whole different story.

Subject: RE: There is a 64KB limit per document…

Sorry, Ben, but I just pointed out about summary data limitation.Me myself I have a huge database with more than thousand users that uses dynamic tables in Multi-Value fields with dialogs. I found the solution in sandbox - i don’t remember who wrote it - and adapted it to my needs.

Then, having like 15 dynamic tables in a document, I met the undocumented 64 Kb per document limit.

So, always using an RichText - like your MIDAS RT extension is an option, other option is to use that guy’s option.

Also in last THE VIEW I think there is an database that shows solution for dynamic tables in document - very nicely done (not exactly 100% good coding, but still very nice idea).

So, that’s the way it is.

Nahum

P.S. Seems that I will need to trouble you sometime… LOL.

Subject: RE: There is a 64KB limit per document…

This information is indeed informative, but it is a far cry from the help that I originally requested; can any of you offer some insight to my original query?

Subject: RE: There is a 64KB limit per document…

True… Did you gave us information about size of your database to receive answer better that I gave you?

Allways it’s possible to search using FULLTEXT, without need to do all the stuff - give me exact specification what you need and why you have to do it that way - then it’s possible to speak about architecture issues.

Subject: Clarification of original query

I have a dynamic table in a form that generates a new row containing about 6 columns every time a user wishes to add to it. I need to find a way to list the entries in a view for categorization and searching:

(example of the table)

Name Item # Priority Status

Pluto 2006-10-17-32 High Complete

Goofy 2006-10-17-45 Medium Pending

However each column in the above table is single field that needless to say has multiple values. So, for example, in a view I would need to list Pluto as the name, and have the correlating data display either in the same view or in a document when opened. Any suggestions to this end would be appreciated. Thanks again.

Subject: RE: Clarification of original query

Ok, here we go. I think this should work. But with normal amounts of data only - categorization does take HUGE amount, especially when both ways. Your views may jump to a lot of megabytes - slow response times…

Create additional field, multi-value text, that contains @Implode’d multi-values. Use “~” or something else very strange as separator.

In view use “show multiple values as entries” in hidden row, and in every column use @Explode and Array.

Althought… It’s very VERY heavy on your server.

And it’s wrong to do it this way unless you work with up to small amount of rows - don’t forget you want a lot of “Categorizations”…

I still think that Full Text Search is the best for searching - but hard to tell as there are couple of bottle necks in your architecture.

Subject: RE: Clarification of original query

Please read my earlier posting in this thread, which explains exactly how to do this. I have written about this technique in this forum several times, in at least one case including an illustration.