Пример #1
0
        public static void ReadingOrder(XlsxAlignment.ReadingOrder readingOrder, ExcelReadingOrder expected)
        {
            using (var stream = new MemoryStream())
            {
                using (var xlsxWriter = new XlsxWriter(stream))
                    xlsxWriter.BeginWorksheet("Sheet 1").BeginRow()
                    .Write("Test", XlsxStyle.Default.With(new XlsxAlignment(readingOrder: readingOrder)));

                using (var package = new ExcelPackage(stream))
                    package.Workbook.Worksheets[0].Cells["A1"].Style.ReadingOrder.Should().Be(expected);
            }
        }
Пример #2
0
 internal ExcelXfs(XmlNamespaceManager nsm, XmlNode topNode, ExcelStyles styles) :
     base(nsm, topNode)
 {
     _styles = styles;
     _xfID   = GetXmlNodeInt("@xfId");
     if (_xfID == 0)
     {
         isBuildIn = true;             //Normal taggen
     }
     _numFmtId            = GetXmlNodeInt("@numFmtId");
     _fontId              = GetXmlNodeInt("@fontId");
     _fillId              = GetXmlNodeInt("@fillId");
     _borderId            = GetXmlNodeInt("@borderId");
     _readingOrder        = GetReadingOrder(GetXmlNodeString(readingOrderPath));
     _indent              = GetXmlNodeInt(indentPath);
     _shrinkToFit         = GetXmlNodeString(shrinkToFitPath) == "1" ? true : false;
     _verticalAlignment   = GetVerticalAlign(GetXmlNodeString(verticalAlignPath));
     _horizontalAlignment = GetHorizontalAlign(GetXmlNodeString(horizontalAlignPath));
     _wrapText            = GetXmlNodeBool(wrapTextPath);
     _textRotation        = GetXmlNodeInt(textRotationPath);
     _hidden              = GetXmlNodeBool(hiddenPath);
     _locked              = GetXmlNodeBool(lockedPath, true);
     _quotePrefix         = GetXmlNodeBool(quotePrefixPath);
 }
Пример #3
0
 internal ExcelXfs(XmlNamespaceManager nsm, XmlNode topNode, ExcelStyles styles)
     : base(nsm, topNode)
 {
     _styles = styles;
     _xfID = GetXmlNodeInt("@xfId");
     if (_xfID == 0) isBuildIn = true; //Normal taggen
     _numFmtId = GetXmlNodeInt("@numFmtId");
     _fontId = GetXmlNodeInt("@fontId");
     _fillId = GetXmlNodeInt("@fillId");
     _borderId = GetXmlNodeInt("@borderId");
     _readingOrder = GetReadingOrder(GetXmlNodeString(readingOrderPath));
     _indent = GetXmlNodeInt(indentPath);
     _shrinkToFit = GetXmlNodeString(shrinkToFitPath) == "1" ? true : false;
     _verticalAlignment = GetVerticalAlign(GetXmlNodeString(verticalAlignPath));
     _horizontalAlignment = GetHorizontalAlign(GetXmlNodeString(horizontalAlignPath));
     _wrapText = GetXmlNodeBool(wrapTextPath);
     _textRotation = GetXmlNodeInt(textRotationPath);
     _hidden = GetXmlNodeBool(hiddenPath);
     _locked = GetXmlNodeBool(lockedPath,true);
 }