Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Often your application will pull data from a database and store it in the form of a DataTable. You can easily insert this data into your document as a new table and quickly apply formatting to the whole table.
Using Aspose.Words, you can easily retrieve data from a database and store it as a table:
The ImportTableFromDataTable method accepts a DocumentBuilder object, the DataTable containing the data and a flag which specifies if the column heading from the DataTable are included at the top of the table. This method builds a table from these parameters using the builder’s current position and formatting. Provides a method to import data from the DataTable
and insert it into a new table using the DocumentBuilder.
The following data in our DataTable is used in this example:
The following code example shows how to execute the above algorithm in Aspose.Words:
The method can then be easily called using your DocumentBuilder and data.
The following code example shows how to import the data from a DataTable
and insert it into a new table in the document:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.