Exemplo n.º 1
0
        public void Create(Bilan bilan, string path)
        {
            var splitPath = path.Split('\\');
            var pathFile = splitPath.Take(splitPath.Count() - 1).Aggregate((e, p) => e + "\\" + p) + "\\";

            var fileNameOld = splitPath.Last();

            var fileName = "synoptique_" + fileNameOld;

            using (var stream = new FileStream(pathFile + fileName, FileMode.Create, FileAccess.Write))
            {
                var workbook = new XSSFWorkbook();
                var sheet = workbook.CreateSheet("synoptique");

                var cadreArmoire = new CadreArmoire(sheet, workbook);
                cadreArmoire.Create(bilan.PageDeGarde.ChambrePMZ);

                var cadrePA = new CadrePA(sheet, workbook);
                cadrePA.Create(bilan.PageDeGarde.ChambrePointAboutement);

                var positionnementEtudeCreator = new PositionnementEtudeCreator(sheet, workbook);

                var hauteur = 9;
                var numeroCassette = 0;
                foreach (var positionnementEtude in bilan.PositionnementEtudes)
                {
                    positionnementEtudeCreator.Create(positionnementEtude, ref hauteur, ref numeroCassette);
                }

                SetWidth(sheet);

                workbook.Write(stream);
            }
        }
Exemplo n.º 2
0
 private void AfficherTableauBilan()
 {
     ReInitialiserTableau(dgvBilan);
     Bilan.AfficherBilan(dgvBilan, dtpDebut, dtpFin);
 }