Проверка на DateOnly в ExcelColumnHeaders
This commit is contained in:
parent
0221ad1e7a
commit
71a2524338
@ -56,7 +56,12 @@ namespace Components
|
|||||||
var property = data.GetType().GetProperty(headersConfig[rowIndex].propertyName);
|
var property = data.GetType().GetProperty(headersConfig[rowIndex].propertyName);
|
||||||
if (property != null)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||||
<Authors>ns.potapov</Authors>
|
<Authors>ns.potapov</Authors>
|
||||||
<VersionPrefix>1.0.7</VersionPrefix>
|
<VersionPrefix>1.1.0</VersionPrefix>
|
||||||
<Version>$(VersionPrefix)</Version>
|
<Version>$(VersionPrefix)</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ namespace WinFormsApp
|
|||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new FormVisual());
|
Application.Run(new FormNoVisual());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user