Example #1
0
        internal static TXlsxPivotTableRecord Load(TOpenXmlReader DataStream)
        {
            TXlsxPivotLocationRecord Result = new TXlsxPivotLocationRecord();

            Result.Refe           = DataStream.GetAttributeAsRange("ref", true);
            Result.firstHeaderRow = DataStream.GetAttributeAsInt("firstHeaderRow", 0);
            Result.firstDataRow   = DataStream.GetAttributeAsInt("firstDataRow", 0);
            Result.firstDataCol   = DataStream.GetAttributeAsInt("firstDataCol", 0);
            Result.rowPageCount   = DataStream.GetAttributeAsInt("rowPageCount", 0);
            Result.colPageCount   = DataStream.GetAttributeAsInt("colPageCount", 0);
            DataStream.FinishTag();
            return(Result);
        }
Example #2
0
        internal static TRangeSet LoadFromXlsx(TOpenXmlReader DataStream)
        {
            TRangeSet Result = new TRangeSet();

            for (int i = 0; i < Result.ix.Length; i++)
            {
                Result.ix[i] = DataStream.GetAttributeAsInt("i" + (i + 1).ToString(CultureInfo.InvariantCulture), -1);
            }
            Result.Source = new TWorksheetSource();
            Result.Source.LoadAttsFromXlsx(DataStream);
            DataStream.FinishTag();
            return(Result);
        }
Example #3
0
        private TShapePath ReadPath(TShapeGeom ShapeGeom)
        {
            TShapePath Result = new TShapePath();

            if (DataStream.IsSimpleTag)
            {
                DataStream.NextTag(); return(Result);
            }

            Result.Width       = DataStream.GetAttributeAsInt("w", 0);
            Result.Height      = DataStream.GetAttributeAsInt("h", 0);
            Result.PathFill    = GetPathFill(DataStream.GetAttribute("fill"));
            Result.PathStroke  = DataStream.GetAttributeAsBool("stroke", true);
            Result.ExtrusionOk = DataStream.GetAttributeAsBool("extrusionOk", true);

            string StartElement = DataStream.RecordName();

            if (!DataStream.NextTag())
            {
                return(Result);
            }

            while (!DataStream.AtEndElement(StartElement))
            {
                switch (DataStream.RecordName())
                {
                case "close":
                    Result.Actions.Add(new TShapeActionClose());
                    DataStream.FinishTag();
                    break;

                case "moveTo":
                    Result.Actions.Add(new TShapeActionMoveTo(ReadPt(ShapeGeom)));
                    break;

                case "lnTo":
                    Result.Actions.Add(new TShapeActionLineTo(ReadPt(ShapeGeom)));
                    break;

                case "arcTo":
                    TShapeActionArcTo ArcTo = new TShapeActionArcTo();
                    ArcTo.WidthRadius  = GetGuideFromAtt("wR", ShapeGeom);
                    ArcTo.HeightRadius = GetGuideFromAtt("hR", ShapeGeom);
                    ArcTo.StartAngle   = GetGuideFromAtt("stAng", ShapeGeom);
                    ArcTo.SwingAngle   = GetGuideFromAtt("swAng", ShapeGeom);
                    Result.Actions.Add(ArcTo);
                    DataStream.FinishTag();
                    break;

                case "quadBezTo":
                    Result.Actions.Add(new TShapeActionQuadBezierTo(ReadPts(ShapeGeom, "pt").ToArray()));
                    break;

                case "cubicBezTo":
                    Result.Actions.Add(new TShapeActionCubicBezierTo(ReadPts(ShapeGeom, "pt").ToArray()));
                    break;

                default: DataStream.GetXml(); break;
                }
            }

            return(Result);
        }