| @@ -15,6 +15,7 @@ namespace BlackRockReportFunction.Bussines | |||
| public static Workbook GenerateReportContent(Root reportObject) | |||
| { | |||
| var excelFile = new Workbook(); | |||
| excelFile.Worksheets.Clear(); | |||
| var ws = excelFile.Worksheets.Add("Content"); | |||
| AddReportItems(reportObject, ws); | |||
| @@ -30,7 +31,6 @@ namespace BlackRockReportFunction.Bussines | |||
| TimeSpan t, time, time1; | |||
| int row = 1; | |||
| string[] sectionNames = { "User ", "Description ", "Time (h) ", "Time (decimal) " }; | |||
| decimal totalAmountSum = 0; | |||
| List<string> usersDecimalHours = new List<string>(); | |||
| for (int i = 0; i < sectionNames.Length; i++) | |||
| @@ -8,6 +8,7 @@ | |||
| <ItemGroup> | |||
| <PackageReference Include="Azure.Storage.Blobs" Version="12.12.0" /> | |||
| <PackageReference Include="Azure.Storage.Queues" Version="12.10.0" /> | |||
| <PackageReference Include="FreeSpire.XLS" Version="12.7.0" /> | |||
| <PackageReference Include="MailKit" Version="3.3.0" /> | |||
| <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" /> | |||
| <PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" /> | |||
| @@ -19,7 +20,6 @@ | |||
| <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.SendGrid" Version="3.0.2" /> | |||
| <PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.2.0" /> | |||
| <PackageReference Include="RestSharp" Version="108.0.1" /> | |||
| <PackageReference Include="Spire.XLS" Version="12.7.1" /> | |||
| <PackageReference Include="System.Core" Version="3.5.21022.801" /> | |||
| <PackageReference Include="System.Drawing.Common" Version="6.0.0" /> | |||
| <PackageReference Include="System.IO.Packaging" Version="6.0.0" /> | |||
| @@ -28,7 +28,7 @@ namespace ClockifyReport | |||
| [Function("Function3")] | |||
| public void Run([BlobTrigger("report-container/{name}", Connection = "AzureWebJobsStorage")] byte[] fileData, string name, ILogger log) | |||
| { | |||
| string fileName = string.Format($"BlackRockReport_{DateTime.Now.ToString("f")}.xlsx"); | |||
| string fileName = string.Format($"BlackRockReport_{DateTime.Now.ToString("f")}.xls"); | |||
| var client = new RestClient("https://api.mailgun.net/v3"); | |||
| client.Authenticator = new HttpBasicAuthenticator("api", MailGunApiKey); | |||