diff --git a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj index e0ae1c7..bb7d3cd 100644 --- a/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj +++ b/src/Dynamicweb.DataIntegration.Providers.ExcelProvider.csproj @@ -1,6 +1,6 @@  - 10.0.13 + 10.0.14 1.0.0 Excel Provider Excel Provider diff --git a/src/ExcelProvider.cs b/src/ExcelProvider.cs index 4f6736d..ff86841 100644 --- a/src/ExcelProvider.cs +++ b/src/ExcelProvider.cs @@ -261,8 +261,13 @@ private void GetSchemaForTableFromFile(Schema schema, Dictionary CustomFields = ProductField.GetProductFields(); + private const string CommentsAuthor = "Dynamicweb"; public ExportDataToExcelProvider() { @@ -68,20 +69,26 @@ private ExcelPackage GetExcelPackage(string file) private ExcelWorksheet GetExcelWorksheet(ExcelPackage package, string title) { - ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(title); + ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(title); return worksheet; } private ExcelRange AddCell(ExcelWorksheet worksheet, string text, int row, int column) { ExcelRange cell = worksheet.Cells[row, column]; - cell.Value = text; + cell.Value = text; return cell; } - private void AddHeaderCell(ExcelWorksheet worksheet, string text, int row, int column) + private void AddHeaderCell(ExcelWorksheet worksheet, string text, int row, int column, string fieldSystemName) { - AddCell(worksheet, text, row, column); + var cell = AddCell(worksheet, text, row, column); + if(!string.IsNullOrEmpty(fieldSystemName) && + (fieldSystemName.StartsWith("CustomFields|", System.StringComparison.OrdinalIgnoreCase) || + fieldSystemName.StartsWith("CategoryFields|", System.StringComparison.OrdinalIgnoreCase))) + { + cell.AddComment(fieldSystemName, CommentsAuthor); + } } private void AddHeader(ExcelWorksheet worksheet, IDictionary fields) @@ -99,7 +106,7 @@ private void AddHeader(ExcelWorksheet worksheet, IDictionary fie { caption = GetFieldCaption(field, defaultLanguage); } - AddHeaderCell(worksheet, caption, firstRowIndex, lastColumnIndex++); + AddHeaderCell(worksheet, caption, firstRowIndex, lastColumnIndex++, field); } }