Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
經常你應用程式會從資料庫取出資料,以 DataTable 的形式儲存。 您可以輕鬆將此資料插入您的文件中,作為新表格,並快速為整張表格應用格式。
使用 Aspose.Words,您可以輕易地從資料庫中取得資料並儲存在一個表格中:
ImportTableFromDataTable" 方法接受一個"DocumentBuilder" 物件,以及包含資料的"DataTable",還有一個旗標來指定是否包含 “DataTable” 中的欄位標題在表格頂端。 這方法用建構器當前的位置和格式來建立這些參數的表格。 提供從 DataTable 匯入資料並將其插入新資料表的方法,透過 DocumentBuilder。
下述資料在我們的 DataTable 中是用來這個範例使用的:

以下範例示範如何在 Aspose.Words 中執行上述演算法。
方法然後可以用您的 DocumentBuilder 和資料輕易地呼叫。
以下範例顯示如何從 DataTable 導入資料並將其插入文書中的新資料表:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.