DMCatalog (Object)

Member of:

DataModelSection object

Description:

Represents the Table Catalog. This object lists the database tables used when a Data Model is built.

Example 1:

This example shows how to create a Data Model by inserting tables from the Table Catalog. It also shows how to change the basic display properties of the Table Catalog:

with (ActiveDocument.Sections["Query"].DataModel)
{
           Catalog.ShowFullName= true
//Updates the Table Catalog with the most current view of the tables
           Catalog.Refresh()
           Table1 =Catalog.CatalogItems["WINE"]
           Table2 =Catalog.CatalogItems["WINE_SALES"]
//Create two new topics from tables in Table Catalog
           Topics.Add(Table1)
           Topics.Add(Table2)
}

Example 2:

This example shows how to list available database tables:

// display Table Catalog
ActiveDocument.Sections["DataModel"].DataModel.Catalog.Refresh()

Example 3:

This example shows how to add topics to a Data Model section:

CatItem = ActiveDocument.Sections["DataModel"].DataModel.Catalog.CatalogItems["PCW_ITEMS"]
ActiveDocument.Sections["DataModel"].DataModel.Topics.Add(CatItem)

Example 4:

This example prints the names of databases for each table in the Table Catalog:

var  TableCatalog = ActiveDocument.Sections["SalesQuery"].DataModel.Catalog
var TableCount = ActiveDocument.TableCatalog.CatalogItems.Count
for (j=1;j<=TableCount;j++)
Console.Writeln (TableCatalog.CatalogItems[j].Name)

Methods:

Refresh()

Properties:

Read-write: Property ShowDerivableQueries as Boolean, Property ShowFullNames As Boolean, Property ShowLocalResults As Boolean

Collections:

CatalogItems As DMCatalogItems, Results As Results