C# How to Insert XmlMap into Excel file using XlsIO

Hi, looking for anyone who has managed to insert an XmlMap into an Excel file using XlsIO. I'm wondering if you use CustomXmlPart but it needs to appear as it would when you open Excel with Developer Tools and click on the Source button. 

Any help or pointers would be much appreciated. Thanks.

Iain


6 Replies

AS Atchaya Sekar Syncfusion Team July 5, 2024 10:30 AM UTC

Hi Lain,

 

We are currently validating your requirement and will share more details on July 9th, 2024.

 

Regards,

Atchaya S.



AS Atchaya Sekar Syncfusion Team July 9, 2024 05:14 PM UTC

Hi Lain,

 

Due to the complexity of the issue, we are unable to share details today. We will share details on July 10, 2024.

 

Regards,

Atchaya S.



AS Atchaya Sekar Syncfusion Team July 10, 2024 04:32 PM UTC

Hi Lain,

 

Currently, XlsiO doesn't support for adding and importing XML files into the worksheet. We have confirmed the issue as "Support for adding and importing XML files into the worksheet" and logged a defect report. We are going to implement this feature. The fix for this issue will be included in our upcoming weekly NuGet release scheduled for July 30, 2024.

 

You can track the status of the defect report through feedback link.

 

 

Regards,

Atchaya S.



AS Atchaya Sekar Syncfusion Team July 31, 2024 05:02 AM UTC

Hi Lain,

 

Sorry for the inconvenience,

 

Due to Complexity, we will include the fix for this issue in our upcoming weekly NuGet release scheduled for August 06, 2024.

 

Regards,

Atchaya S.



AS Atchaya Sekar Syncfusion Team August 6, 2024 01:29 PM UTC

Hi Iain Dalgleish ,

 

We appreciate your patience.

 

We have included the fix to resolve the issue "Support for adding and importing XML files into the worksheet" in our weekly NuGet release version 26.2.8. Kindly upgrade your Syncfusion packages to this new 26.2.8 version and let us know if the issue is resolved.

 

NuGet Package: NuGet Gallery | Syncfusion.XlsIO.Net.Core 26.2.8

 

Note : We provide support for adding and importing XML files into the worksheet, but not for schema files. Please refer the below attached sample and code snippet.

 

Code Snippet:

 

Code Snippet for Importing Xml File

 using (ExcelEngine excelEngine = new ExcelEngine())

 {

     IApplication application = excelEngine.Excel;

 

     IWorkbook workbook = application.Workbooks.Create();

     IWorksheet worksheet = workbook.Worksheets[0];

 

     worksheet.ImportXml(@"../../../Data/XmlFile.xml", 1, 6);

 

     string fileName = @"../../../Output/ImportXml.xlsx";

     //Saving the workbook as stream

     FileStream stream1 = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);

     workbook.SaveAs(stream1);

     stream1.Dispose();

         

 

 }

Code Snippet for  Add the Xml File

 using (ExcelEngine excelEngine = new ExcelEngine())

 {

     IApplication application = excelEngine.Excel;

 

     IWorkbook workbook = application.Workbooks.Create();

     IWorksheet worksheet = workbook.Worksheets[0];

 

     workbook.XmlMaps.Add(@"../../../Data/XmlFile.xml");

 

     string fileName = @"../../../Output/Sample1.xlsx";

     //Saving the workbook as stream

     FileStream stream1 = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);

     workbook.SaveAs(stream1);

     stream1.Dispose();

 }

 

 

Regards,

Atchaya S.


Attachment: XmlConsoleApp_37039c0d.zip


AS Atchaya Sekar Syncfusion Team September 19, 2024 11:56 AM UTC

Hi lain,


We have included the feature for "Support for adding and importing XML files into the worksheet"  in our volume 3 release version 27.1.48. Kindly upgrade your Syncfusion packages to this new 27.1.48 version and let us know if the issue is resolved.


Feedback : Support for importing XML data into Excel worksheet in ASP.NET Core | Feedback Portal (syncfusion.com)


UG Link : Import to Excel document | Syncfusion


We are glad to announce that our Essential Studio 2024 Volume 3 release v27.1.48 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/194459/essential-studio-2024-volume-3-main-release-v27-1-48-is-available-for-download


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Atchaya S.


Loader.
Up arrow icon