Free Support Forum - aspose.com

Fields in concated cells

Hi,

we have problems to update concated cells in XLSX-document (Aspose.xlsx).
The concated cell using the cell which reference an Excel-Field.
Saving the document to HTML (Aspose.html) the concated cell won´t be updated.
Saving the XLSX-document back (Aspose_save.xlsx), all fields are updated.

Look at the attachements of this post.

Hi,


Well, you need to call Workbook.CalculateFormula() method before rendering to HTML file format, see the updated sample code for your reference:

Sample code:
//…

//Aspose.Cells.License licW = new Aspose.Cells.License();
//licW.SetLicense(“Aspose.Total.lic”);

string htmlPath = Path.Combine(Path.GetDirectoryName(tbFilepath.Text), string.Concat(Path.GetFileNameWithoutExtension(tbFilepath.Text), “.html”));
string pdfPath = Path.Combine(Path.GetDirectoryName(tbFilepath.Text), string.Concat(Path.GetFileNameWithoutExtension(tbFilepath.Text), “.pdf”));

Aspose.Cells.Workbook doc = new Aspose.Cells.Workbook(tbFilepath.Text);
//doc.UpdateFields();

doc.CalculateFormula();

doc.Save(Path.Combine(Path.GetDirectoryName(tbFilepath.Text), string.Concat(Path.GetFileNameWithoutExtension(tbFilepath.Text), “_save”, Path.GetExtension(tbFilepath.Text))));

// HTML
Directory.CreateDirectory(Path.GetDirectoryName(htmlPath));
doc.Save(htmlPath);

// PDF

MessageBox.Show(“Complete”);

//…

Thank you.

Hi,

thanks for the quick support.
Using doc.CalculateFormula(); fix the issue.

Hi,


Good to know that your issue is resolved now by calling the suggested method (Workbook.CalculateFormula).

Feel free to contact us any time if you need further help or have some other query, we will be happy to assist you soon.

Thank you.