AceoffixCtrlBind Method |
Namespace: Aceoffix
When output data to Word document or Excel workbook, you must create a data source object and call Bind method.
If you need to call Bind method, you must call it before calling OpenDocument or CreateNewDocument method.
![]() |
---|
The type of SourceObj parameter should be the same as the type of document opened through OpenDocument method. For example, if SourceObj is a WordDocument object, the OpenDocument method should open a Word document. |
The following code example shows how to use the Bind method.
Word code example:
Aceoffix.WordWriter.WordDocument wd = new Aceoffix.WordWriter.WordDocument(); Aceoffix.WordWriter.DataRegion dataRegion = wd.OpenDataRegion("name"); dataRegion.Value = "John Scott"; AceoffixCtrl1.Bind(wd); //The data source is a WordDocument object.
Excel code example:
Aceoffix.ExcelWriter.Workbook wb = new Aceoffix.ExcelWriter.Workbook(); Aceoffix.ExcelWriter.Sheet sheetOrder = wb.OpenSheet("Order"); sheetOrder.OpenCell("B5").Value = "John Scott"; AceoffixCtrl1.Bind(wb); //The data source is a Workbook object.