XML Mappings lost when resaving file

Hi,

I would like to use Aspose.Cells for one of my projects where I want to open XLSX file with XML mappings, change few cells and re-save the file.

When I try to do this with Aspose.Cells (opening existing file, changing few cells, re-saving the file) the XML mappings are missing in target file.

Solution which reproduces the issue is attached.

Feel free to ask for additional details.

Regards,

Robert Haken
Microsoft MVP ASP.NET/IIS
HAVIT, s.r.o., http://www.havit.eu


Hi,


Thanks for providing us sample project with template files.

I observed the issue as you mentioned by using your sample code with your template file. The template file does contain XML maps for certain elements (we can check certain elements are mapped (are set bold) in XML Source window in MS Excel) which lose their mappings in the output Excel file by Aspose.Cells.
e.g
Sample code:

string inOutPath = String.Concat(Environment.CurrentDirectory, @"\InputOutput");
string fileName = “DPH13xx_FINAL.xlsx”;
string outFileName = String.Concat(“Modified_”, fileName);
string fullFileName = Path.Combine(inOutPath, fileName);
string fullOutFileName = Path.Combine(inOutPath, outFileName);

string newValue = “3”;

Workbook workBook = new Workbook(fullFileName);
Worksheet dicWorksheet = workBook.Worksheets[“DPH1”];

Cell dicCell = dicWorksheet.Cells[“J21”];
dicCell.PutValue(newValue);

Style dicCellStyle = dicCell.GetStyle();
dicCellStyle.IsLocked = true;
dicCell.SetStyle(dicCellStyle);

Stream fileStream = File.Create(fullOutFileName);
workBook.Save(fileStream, SaveFormat.Xlsx);

Console.WriteLine(String.Concat("Saved ", fullOutFileName));
Console.WriteLine();
Console.WriteLine(“Press any key to exit.”);
Console.ReadKey();

I have logged a ticket with an id “CELLSNET-42849” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Thanks. Looking forward to see your answer soon. ;-))


Regards,

Robert

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.1.2.1 and let us know your feedback.

It works!


Thank you. Regards,

Robert Haken

Hi,


Thanks for your feedback.

Good to know that your issue is resolved by the new fix/version, we have closed your ticket now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.

The issues you have found earlier (filed as CELLSNET-42849) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,

when we finished our product and tried to move it to production we are fighting “the same” issue again (the sample file is different, the original file seems to be working).

I have attached new sample application which reproduces the bug.

Regards,

Robert Haken [Microsoft MVP ASP.NET/IIS]
HAVIT, s.r.o.

Hi,

Thanks for your feedback and using Aspose.Cells.

We were able to observe this issue by simply opening and saving your source Excel file. The output Excel file is corrupt.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-43342 - Source XLSX file gets corrupt on opening and saving

I have attached the source and output Excel files for a reference.

C#

string filePath = @“F:\AsposeCellsTester\InputOutput\SILDAN14_xml_big.xlsx”;


Workbook workbook = new Workbook(filePath);


workbook.Save(filePath + “.out.xlsx”);

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.3.2.2 and let us know your feedback.

Hi,

the new version works. Looking forward to see it as new stable version on NuGet.

Regards,
Robert Haken

Hi Robert,


Thank you for the confirmation.

This fix will be be part of the next major release of Aspose.Cells for .NET 8.4.0 that is scheduled for the first week of March 2015. Same is the schedule for uploading the release on the Nuget. Please note, you will be automatically notified here as soon as the said release is available for your testing.