Проверка на DateOnly в ExcelColumnHeaders #6

Merged
ns.potapov merged 1 commits from fix_lab2_again into lab2 2024-12-11 22:30:41 +04:00
3 changed files with 8 additions and 3 deletions

View File

@ -56,7 +56,12 @@ namespace Components
var property = data.GetType().GetProperty(headersConfig[rowIndex].propertyName);
if (property != null)
{
worksheet.Cells[rowIndex + 2, colIndex + 3].Value = property.GetValue(data);
if(property.PropertyType == typeof(DateOnly))
{
worksheet.Cells[rowIndex + 2, colIndex + 3].Value = property.GetValue(data).ToString();
}
else
worksheet.Cells[rowIndex + 2, colIndex + 3].Value = property.GetValue(data);
}
}
}

View File

@ -7,7 +7,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>ns.potapov</Authors>
<VersionPrefix>1.0.7</VersionPrefix>
<VersionPrefix>1.1.0</VersionPrefix>
<Version>$(VersionPrefix)</Version>
</PropertyGroup>

View File

@ -11,7 +11,7 @@ namespace WinFormsApp
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new FormVisual());
Application.Run(new FormNoVisual());
}
}
}