НКО Миграция HSSF в (XSSF) ошибка в Патриархе - PullRequest
0 голосов
/ 31 марта 2020

Мне нужна помощь, мой код:

private void InsertarCuadroTexto(ISheet sheet, DateTime fechaIni, DateTime fechaFin)
    {
        var patriarch = (XSSFDrawing)sheet.CreateDrawingPatriarch();

        var anchor = new XSSFClientAnchor(800, 16, 512, 240, 6, 1, 11, 1)
        {
            AnchorType = (int)AnchorType.MoveAndResize
        };
        var textbox1 = patriarch.CreateTextbox(anchor);
        var rts = new XSSFRichTextString(string.Format("Periodo\r De {0}  a   {1}", fechaIni.ToShortDateString(), fechaFin.ToShortDateString()));

        IFont font = _workbook.CreateFont();
        font.FontHeightInPoints = 10;
        font.FontName = "Calibri";
        rts.ApplyFont(font);   

        textbox1.String = rts;
        textbox1.LineStyle = LineStyle.Solid;
        textbox1.HorizontalAlignment = HorizontalTextAlignment.Center;
        textbox1.SetLineStyleColor(188, 188, 188);
        textbox1.MarginTop = 5;
        textbox1.MarginBottom = 5;
        textbox1.MarginLeft = 10;
        textbox1.MarginRight = 10;

У меня ошибка в строках:

textbox1.String = rts;
textbox1.HorizontalAlignment = HorizontalTextAlignment.Center;
textbox1.MarginTop = 5;
textbox1.MarginBottom = 5;
textbox1.MarginLeft = 10;
textbox1.MarginRight = 10;

Не существует в XSSF? В HSSF код это нормально. Но в XSSF нет. Как я могу редактировать поля сейчас?

...