private void CreateTemplateVisitorPlayers(ExcelPackage package) { var sheet = package.Workbook.Worksheets["Tegenstanders"]; //sheet.Column(1).Width = 20; sheet.Cells["A1"].Value = GetTheirTeamDesc(); //sheet.Cells["A2"].Value = "Naam"; //sheet.Cells["B2"].Value = "Lidkaart"; //sheet.Cells["C2"].Value = "Klassement"; //sheet.Cells["D2"].Value = "Waarde"; int rowIndex = 3; foreach (var opponent in _opponentPlayers.OrderBy(x => x.Name)) { sheet.Cells["A" + rowIndex].Value = opponent.Name; sheet.Cells["B" + rowIndex].Value = opponent.LidNummerSporta; sheet.Cells["C" + rowIndex].Value = opponent.KlassementSporta; sheet.Cells["D" + rowIndex].Value = _klassementCalc.Sporta(opponent.KlassementSporta); rowIndex++; } var spelersRange = package.Workbook.Names["tegenstanders"]; spelersRange.Address = "'Tegenstanders'!$A$3:$A$" + rowIndex; }
private void SetSportaSheet(ExcelWorksheet worksheet) { ExcelHelper.SetHeader( worksheet, ExcelExportResources.CompetitionVolgnummer, ExcelExportResources.CompetitionIndex, ExcelExportResources.CompetitionLidnummer, ExcelExportResources.PlayerName, ExcelExportResources.PlayerRanking, ExcelExportResources.PlayerRankingValue ); int i = 2; var rankingValueConverter = new KlassementValueConverter(); foreach (var player in _players.Where(x => x.ClubIdSporta == Constants.OwnClubId).OrderBy(x => x.VolgnummerSporta)) { worksheet.Cells[i, 1].Value = player.VolgnummerSporta; worksheet.Cells[i, 2].Value = player.IndexSporta; worksheet.Cells[i, 3].Value = player.LidNummerSporta; worksheet.Cells[i, 4].Value = player.Naam; worksheet.Cells[i, 5].Value = player.KlassementSporta; worksheet.Cells[i, 6].Value = rankingValueConverter.Sporta(player.KlassementSporta); i++; } worksheet.Cells.AutoFitColumns(); }
private void SetSportaSheet(ExcelWorksheet worksheet) { ExcelHelper.SetHeader( worksheet, ExcelExportResources.CompetitionVolgnummer, ExcelExportResources.CompetitionIndex, ExcelExportResources.CompetitionLidnummer, ExcelExportResources.PlayerName, ExcelExportResources.PlayerRanking, ExcelExportResources.PlayerRankingValue ); int i = 2; var rankingValueConverter = new KlassementValueConverter(); foreach (var player in _players.Where(x => x.ClubIdSporta == Constants.OwnClubId).OrderBy(x => x.VolgnummerSporta)) { worksheet.Cells[i, 1].Value = player.VolgnummerSporta; worksheet.Cells[i, 2].Value = player.IndexSporta; worksheet.Cells[i, 3].Value = player.LidNummerSporta; worksheet.Cells[i, 4].Value = player.Name; worksheet.Cells[i, 5].Value = player.KlassementSporta; worksheet.Cells[i, 6].Value = rankingValueConverter.Sporta(player.KlassementSporta); i++; } worksheet.Cells.AutoFitColumns(); }
private static PlayerCompetition CreateSportaPlayer(KlassementValueConverter converter, int clubId, int uniqueIndex, string frenoyLink, string ranking, int position, int rankingIndex) { return new PlayerCompetition( Competition.Sporta, clubId, uniqueIndex, frenoyLink, ranking, position, rankingIndex, converter.Sporta(ranking)); }