DocxDataMixin is a design found in WordUtilities.* This Design is a mixin that defines the input data for a WordDoc Design.
*Note: WordUtilities is a shared Project which is found under ‘EI Utilities’ user account.
docxData: | This is where name: values pairs are written for the word document. The example shows an Array included under myrows. |
Example:
{ Customer: "John Smith",
Street1: "11361 Miller Rd.",
Phone: "815-555-1212",
CityStateZip: "Chicago, Il., 60556",
OrderTag: "0024",
QuoteDate: this.Date,
QuotePrice: "$" + this.Total.toString(),
Weight: this.Weight.toString()+ " lbs",
Description: this.TableDimensions+" " + this.MaterialSelected + " Table" ,
imageInfo: {width:8, height:8, path:child.imagePath},
mytable: {
myrows: [
{ qty: "1", description: this.MaterialSelected + " Table Material Cost", unitprice: this.Cost.toString(), amount: this.Cost.toString()},
{ qty: "1", description:"Labor " + this.LaborHours.toString()+" hrs", unitprice: this.LaborUnitCost.toString(), amount: this.LaborCost.toString()},
{ qty: "1", description:"Stain and Seal", unitprice: this.StainAndSeal.toString(), amount:this.StainAndSeal.toString() },
{ qty: "", description:"", unitprice: "Subtotal", amount: this.SubTotal.toString() },
{ qty: "", description:"", unitprice: "Sales Tax " + this.SalesTax.toString() +"%", amount: this.SalesTaxTotal.toString()},
{ qty: "", description:"", unitprice: "TOTAL", amount: "$"+this.Total.toString()}
]
}
}
forWordSpec: | Enter the specName of a WordDoc to which this piece of data should be extracted to. This should be an array of specNames; |
Example: | ["docA"] |
Note: DocxDataMixin in the example below is used as the mixin for a design called DocumentData.
BaseAssembly
RULE NAME |
TYPE |
DEFAULTS |
CATEGORY |
FLAGS |
docxData |
Any |
{} |
DocxDataMixin |
Cached |
forWordSpec |
Array |
["default"] |
DocxDataMixin |
Cached |
In your kBridge Examples Projects folder open the project called ‘Table_KB_Inventor_Example’.
Reference Location:
"world.tableapplication1.drawingdocumenttable.drawingdocumenttable0.worddocument.
worddocument0.documentdata.documentdata0"
Link: https://knowledgebridge.engineer/projects
See Unit 20, Word Integration in the Self-guided Training for more detailed information.