Loading an IMDD in-memory table with a filtered subset of a file plus parent fields, for one report

Applies to: IMDD (the in-memory driver and its templates) in a Clarion 6 group thread; the poster named C6 build 9056 on Vista.

Problem

The poster wanted a read-only in-memory file holding a few fields from a filtered activity list plus a couple of fields from the parent Master file, built when one procedure starts and deleted afterwards. After installing IMDD he found no template to load it, only the cloning feature for a physical file, and no simple way to load a filtered subset.

Solution

  1. Treat the IMDD table like any other file; it is always empty at the start and you fill it.
  2. The IMDD templates have to be registered by hand, which is why none showed up.
  3. In the dictionary, copy the table you want in memory, change the driver (mind the NAME attribute), and define the relations as for a normal file.
  4. For a multi-DLL app, add the IMDD global template in the data DLL and select the tables in the dictionary; this produces a .GEM file of the settings. Other DLLs add the global template and "get" that .GEM file.
  5. In the procedure, use the IMDD control template in the Init embed, before the file load, to load the table.
  6. To load a filtered subset: run a process before the report that cycles the activity records and writes them into the IMDD file. Use the activity file as the primary file, and fetch the parent record for each activity record before writing the IMDD fields, with the relations defined in the dictionary.
  7. Another poster saves and loads the table through xFiles XML: xFileXml.Load(myTable, xmlFileName) and xFileXml.Save(myTable, xmlFileName).

Caveats

  • Keep the NAME() attribute short; one poster recalled a small maximum, perhaps 8 characters, without being sure.
  • One poster found the IMDD tables came out of the global template unordered; another said that was true of his copy.
  • The poster said he would try the ideas later and did not report back.

Today (2026)

Not re-tested; the registration and driver details are for the Clarion 6 era and may differ on a current build.

Sources: Rocky P. (Feb 2008, the question), George R., Ben B., Jeff S., Jean-Pierre G., Sean C. (Feb 2008) in softvelocity.public.clarion6.