We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Create an Excel file dynamically with dynamic rows and dynamic columns in .NET

Hi guys,
I faced a critical problem, here are my requirements:

  1. I have a Dataset which contains all the required data coming from Database.
  2. It can contain dynamic row and dynamic column.
  3. Insert the dataset in the excel file.
  4. Format the data using Excel 2007 predefined table format styles ,like the following screenshot
    image.png (2.2 KB)
  5. This things will go into a template file (.XLSX), which does not contain any Formula or Predefined table.

Can we actually do that ? Please help me out.


Yes, you can achieve your desired tasks using Aspose.Cells for .NET APIs. Aspose.Cells does support to import data from variety of data sources (DateTable, DataColumn, custom objects, Arrays, ArrayList, JSON, DataView/DataGrid, etc.) into Excel spreadsheets (either new or existing workbooks), see the document on data importing options with examples for your reference.

Once the data is imported into the worksheet in the workbook, you may add list objects/Tables based on the whole data range and specify your desired table style/formatting it. See the document on create and manage tables of Microsoft Excel files for your reference.

PS. you need to use your own code (using .NET APIs) to import data from database and fill some data table(s) or other containers with it.