TableFacts (Collection)

Member of:

ReportTable object

Description:

Represents all table fact objects in the report section.

Note:

If you use the Add (Method), Move (Method), and Remove (Method) with this collection, and the SuspendCalculation (Property) is true ( default), use the Recalculate (Method) to force recalculate the Report section.

Example 1:

This example shows how add the Unit Sales column to the table:

ActiveDocument.Sections["Report"].Body.Tables["Table"].Facts.Add("Unit Sales")
ActiveDocument.Sections["Report"].Recalculate()

Example 2:

This example shows how to use the AddComputed (Method) to divide the Amount Sales column by the Unit Sales column and display the results in a new computed column called My Computed:

var myStr ="Tables(\"Results\").Columns(\"Amount_Sales\").Sum(currBreak)  / Tables(\"Results\").Columns(\"Unit_Sales\").Sum(currBreak)"; 
ActiveDocument.Sections["Report"].Body.Tables["Table"].Facts.AddComputed("MyComputed", myStr,bqDataTypeNumber)
ActiveDocument.Sections["Report"].Recalculate()

Example 3:

This example shows you to how to count the number of tables in the body of the Report section:

Alert(ActiveDocument.Sections["Report"].Body.Tables["Table"].Facts.Count," Number of Tables")
ActiveDocument.Sections["Report"].Recalculate()

Methods:

Add(NewFact as String, [optional] MoveBeforeName as String), AddComputed(Name as String, Expression as String), Item(NameOrIndex as Value), ModifyComputed(OldName as String, NewName as String, Expression as String), RemoveAll()

Properties:

Read-only: Count as Number