LlDbAddTableRelation

Syntax:

INT LlDbAddTableRelation(HLLJOB hJob, LPCTSTR pszTableID, LPCTSTR pszParentTableID, LPCTSTR pszRelationID, LPCTSTR pszRelationDisplayName);

Task:

This method can be used to define relations between the tables added via LlDbAddTable(). List & Label does not directly distinguish between different relation types. You simply pass a relation and its ID, and you can query the current relation later at print time using LlPrintDbGetCurrentTableRelation().

Parameter:

hJob: List & Label job handle

pszTableID: ID of the child table. Must be identical to the ID passed in LlDbAddTable().

pszParentTableID: ID of the parent table. Must be identical to the ID passed in LlDbAddTable().

pszRelationID: Unique ID of the table relation. It is returned by LlPrintDbGetCurrentTableRelation() at print time. Must be unique within a print.

pszRelationDisplayName: Name of the table relation as displayed in the Designer and it is not saved to the project file. If no name is given, the display name and the unique name are identical.

Return Value:

Error code

Hints:

See the hints in chapter Printing Relational Data. Before using the call, the parent and child table must be passed with LlDbAddTable().

Example:

HLLJOB hJob;
hJob = LlJobOpen(0);

LlDbAddTable(hJob, "Orders", NULL);
LlDbAddTable(hJob, "OrderDetails", NULL);
LlDbAddTableRelation(hJob, "OrderDetails", "Orders",
   "Orders2OrderDetails", NULL);
<... etc ...>
LlJobClose(hJob);

See also:

LlDbAddTable, LlDbAddTableSortOrder, LlPrintDbGetCurrentTable, LlPrintDbGet-CurrentTableSortOrder, LlPrintDbGetCurrentTableRelation