Question about Aspose Cells functionality

We currently utilize Aspose Words in our web app, and have over 100 reports, all with tables designed in the Aspose Words structure (table.columns.add , table.rows.add). I have a new requirement to provide all the data displayed in the tables that are in these reports in Excel format.


If we purchase Aspose Cells, can the code used to generate the tables in Aspose Words be re-used to generate the same tables in Cells? or can we generate the tables in Cells and inject them into the word reports? or can we just export the table objects to Cells?

What we are trying to accomplish is to be able to present the data both in Word reports and Excel reports without having to duplicate all the code.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Well, Aspose.Cells is a separate components, it has separate API(s), so the code will be different from the one used by Aspose.Words.

Also, in Aspose.Cells, you do not need to generate tables, because you are already working with spreadsheets which are in tabular form.

All you need is to read your Ms-Word table’s data using Aspose.Words and populate your Spreadsheet cells with Aspose.Cells.

You can also embed your Word file into Spreadsheet using Ole Object Linking & Embedding technology. This way, your entire word document will be embedded in Ms-Excel file.


Like wise, you can embed the Excel file into your Word file, but for that you need to post your query on Aspose.Words forum.

mshakeel.faiz:
Hi,

All you need is to read your Ms-Word table's data using Aspose.Words and populate your Spreadsheet cells with Aspose.Cells.

Do you have any examples of how to use the data from the Word table to populate the spreadsheet cells with Aspose cells?

Hi,

Thanks for your posting and using Aspose.Cells.

Suppose, you have read the date from your Ms-Word file using Aspose.Words and have saved it in string variables.

Then you can insert it into any cell of your choice using the following code. Here I am inserting the date in cell A1.

C#


//Place your string data in cell A1

Cell cell = worksheet.Cells[“A1”];

cell.PutValue(yourStrData);



For your complete reference, please see the following article (subsections).

  • Working with Data
  • =======================================
  • Accessing Cells of a Worksheet
  • Adding Data to Cells
  • Retrieving Data from Cells
  • Find or Search Data
  • Data Sorting
  • Importing Data to Worksheets
  • Exporting Data from Worksheets
  • Tracing Precedents and Dependents
  • Data Filtering and Validation
  • Creating Subtotals
  • Adding Hyperlinks to Link Data
  • Merging UnMerging Cells in the Worksheet
  • Named Ranges

Now the question remains how to read data from your Ms-Word file, you can ask this question from Aspose.Words forum.

Besides, if you can read data from your Ms-Word file in the form of data tables, then you can import your complete data table into your worksheet. Please see the above subsection i.e Importing Data to Worksheets