Browse Source

Fix for Autofit method call.

master
NikolaJovanovic 3 years ago
parent
commit
344e51a9fc

+ 3
- 2
BlackRockReportFunction/BlackRockReportFunction.csproj View File

@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.12.0" />

+ 6
- 6
BlackRockReportFunction/Bussines/ReportGenerator.cs View File

@@ -14,7 +14,7 @@ namespace BlackRockReportFunction.Bussines
{
public static async Task<ExcelFile> GenerateReportContent()
{
string licenseKey = "E0YU-JKLB-WFCE-N52P";
string licenseKey = Environment.GetEnvironmentVariable("GemBoxLicenseKey");
SpreadsheetInfo.SetLicense(licenseKey);

var testObject = new ClockifyReport
@@ -205,12 +205,12 @@ namespace BlackRockReportFunction.Bussines

foreach (var sheet in localFile.Worksheets)
{
//var columnCount = sheet.CalculateMaxUsedColumns() - 1;
var columnCount = sheet.CalculateMaxUsedColumns();

//for (int i = 0; i < columnCount; i++)
//{
// sheet.Columns[i].AutoFit(1, sheet.Rows[0], sheet.Rows[sheet.Rows.Count - 1]);
//}
for (int i = 0; i < columnCount; i++)
{
sheet.Columns[i].AutoFit(1, sheet.Rows[0], sheet.Rows[sheet.Rows.Count - 1]);
}
}

return localFile;

Loading…
Cancel
Save