using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
{
Document doc = new Document(PageSize.A4, 30f, 30f, 30f, 30f);
PdfWriter writer = PdfWriter.GetInstance(doc, ms);
doc.Open();
BaseFont baseFont = BaseFont.CreateFont("C:\\Windows\\Fonts\\arial.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
//Заголовок
PdfContentByte cb = writer.DirectContent;
cb.Rectangle(10f, 10f, doc.PageSize.Width - 20f, doc.PageSize.Height - 20f);
cb.SetFontAndSize(baseFont, 13);
cb.BeginText();
cb.ShowTextAligned(
PdfContentByte.ALIGN_CENTER, "Отчёт", 300f, doc.PageSize.Height - 30f, 0);
cb.EndText();
cb.Stroke();
doc.Close();
}
public virtual ICollection<Player> Players { get; set; }
_context.Team.Include(p=>p.Player);
public partial class Order
{
public string CustomerName { get; set; }
public id CarLabelId { get; set; }
public CarLabel CarLabel { get; set; }
}
public class CarLabel
{
public int Id { get; set; }
public string NameCar { get; set; }
}
public class Check{
public int Id {get;set;}
public ICollection<ProductItem> ProductItem {get;set;}
}
public class Product{
public int Id {get;set;}
public ICollection<ProductItem> ProductItem {get;set;}
}
public class ProductItem{
public int ProductId {get;set;}
public Product Product {get;set;}
public int CheckId {get;set;}
public Check Check {get;set;}
public int Count {get;set;}
}
var summ = _context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 9).Sum(n=>n.Goal).ToString();
var summ1 = _context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 1).Sum(n => n.Goal).ToString();
var calendar = _context.Matchs.Where(i => i.ChampionatId == id).Select(f => new List<string> {
_context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 9).Sum(n=>n.Goal).ToString(),
_context.StatisticPlayers.Where(i => i.MatchId == 143 && i.CommandId == 1).Sum(n => n.Goal).ToString()
});