Работают отчеты в ворд и эксель

This commit is contained in:
Никита Потапов 2024-05-30 02:56:14 +04:00
parent f15d160157
commit 6913a6c543
2 changed files with 31 additions and 0 deletions

View File

@ -31,6 +31,21 @@ namespace PolyclinicBusinessLogic.OfficePackage.AbstractImplementerReports
Text = diagnoseMedicaments.Diagnose.Name,
StyleInfo = ExcelStyleInfoType.Text
});
if (diagnoseMedicaments.Medicaments.Count() > 0)
{
rowIndex++;
}
foreach (var medicament in diagnoseMedicaments.Medicaments)
{
InsertCellInWorksheet(new ExcelCellParameters
{
ColumnName = "B",
RowIndex = rowIndex,
Text = medicament.Name,
StyleInfo = ExcelStyleInfoType.Text
});
rowIndex++;
}
rowIndex++;
}
SaveExcel(info);

View File

@ -36,6 +36,22 @@ namespace PolyclinicBusinessLogic.OfficePackage.AbstractImplementerReports
JustificationType = WordJustificationType.Both
}
});
foreach (var med in diagnoseMedicaments.Medicaments)
{
CreateParagraph(new WordParagraph
{
Texts = new List<(string, WordTextProperties)>
{
(med.Name, new WordTextProperties{ Size = "24"}),
},
TextProperties = new WordTextProperties
{
Size = "24",
JustificationType = WordJustificationType.Center
}
});
}
}
SaveWord(info);
}