Пример #1
0
        public void GetLabelCell(Cell cell)
        {
            var cellContent =  cell.AddParagraph();

            foreach (var img in _images)
            {
                //TODO: Images
            }

            foreach (var txt in _textChunks)
            {
                cellContent.AddText(txt.Text);
                cellContent.Format.Font.Size = Unit.FromPoint(txt.FontSize);
                cellContent.Format.Font.Name = txt.FontName;
                //TODO: Styles
                
            }

            
            cellContent.Format.Alignment = (ParagraphAlignment)_hAlign;
            cell.VerticalAlignment = VerticalAlignment.Top;
        }
Пример #2
0
        private static void CreateMicTable(Document doc, SetItem itemSet, Section section, out Table table, out Row row, out Cell cell)
        {
            table = new Table();
            table.Borders.Width = "0.015cm";

            int i = 0;
            int cntr = 0;

            //Add CEll, Number, MusNumber, Organism to table
            //CEll
            var column = table.AddColumn("0.8cm");
            column.Format.Alignment = ParagraphAlignment.Center;
            // MusNumber
            column = table.AddColumn("2cm");
            column.Format.Alignment = ParagraphAlignment.Center;
            // Organism
            column = table.AddColumn("1.8cm");
            column.Format.Alignment = ParagraphAlignment.Center;

            // Mic
            var micCount = itemSet.MICList.Count;
            double micWidth = ((doc.DefaultPageSetup.PageWidth.Centimeter - 5.5*(section.PageSetup.LeftMargin.Centimeter + section.PageSetup.RightMargin.Centimeter) )
                / micCount);

            for (int j = 0; j < micCount ; j++)
            {
                column = table.AddColumn(micWidth.ToString() + "cm");
                column.Format.Alignment = ParagraphAlignment.Center;
            }

            // Total Mic
            column = table.AddColumn("1.8cm");
            column.Format.Alignment = ParagraphAlignment.Center;

            //Add header row
            row = table.AddRow();

            row.Height = "0.4cm";
            row.HeadingFormat = true;
            row.Borders.Bottom.Width = "0.05cm";

            cell = row.Cells[0];
            cell.AddParagraph("Ячейка");
            cell.VerticalAlignment = VerticalAlignment.Center;

            cell = row.Cells[1];
            cell.AddParagraph("Муз.№");
            cell.VerticalAlignment = VerticalAlignment.Center;

            cell = row.Cells[2];
            cell.AddParagraph("МО");
            cell.VerticalAlignment = VerticalAlignment.Center;

            for (int j = 0; j < micCount ; j++)
            {
                cell = row.Cells[3 + j];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(itemSet.MICList[j].ToString());
            }

            cell = row.Cells[3 + micCount];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph("МПК");
        }