protected XMLShapeModel(PartManager manager, WsDrPart part, AnchorModel startAnchor, AnchorModel endAnchor) { Manager = manager; TwoCellAnchor = new CT_TwoCellAnchor(); CT_Marker from = new CT_Marker { Col = startAnchor.Column, ColOff = "0", Row = startAnchor.Row, RowOff = "0" }; CT_Marker to = new CT_Marker { Col = endAnchor.Column, ColOff = "0", Row = endAnchor.Row, RowOff = "0" }; TwoCellAnchor.From = from; TwoCellAnchor.To = to; ((CT_Drawing)part.Root).TwoCellAnchor.Add(TwoCellAnchor); _startPosition = startAnchor; _endPosition = endAnchor; }
public XMLPictureShapesModel(PartManager manager, CT_Sheet sheetEntry, string drawingId) { _manager = manager; _parent = _manager.GetWorksheetXmlPart(sheetEntry); _pictures = new List <XMLPictureShapeModel>(); foreach (Relationship item in _manager.GetRelationshipsForSheet(sheetEntry, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing")) { if (item.RelationshipId == drawingId) { _drawingrel = item; _drawing = (WsDrPart)_manager.GetPartByLocation(item.RelatedPart).HydratedPart; _ = (Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.Parser.drawingml.x2006.spreadsheetDrawing.CT_Drawing)_drawing.Root; break; } } }
public XMLPictureShapeModel(PartManager manager, WsDrPart part, XmlPart parent, AnchorModel startAnchor, AnchorModel endAnchor, uint uniqueId) : base(manager, part, startAnchor, endAnchor) { this._parent = parent; base.TwoCellAnchor.Choice_0 = CT_TwoCellAnchor.ChoiceBucket_0.pic; base.TwoCellAnchor.ClientData = new CT_AnchorClientData(); this.Picture.NvPicPr = new CT_PictureNonVisual(); this.Picture.NvPicPr.CNvPicPr = new CT_NonVisualPictureProperties(); this.Picture.NvPicPr.CNvPr = new CT_NonVisualDrawingProps(); this.Picture.NvPicPr.CNvPr.Id_Attr = uniqueId; this.Picture.NvPicPr.CNvPr.Name_Attr = "Picture " + uniqueId; this.Picture.BlipFill = new CT_BlipFillProperties(); this.Picture.BlipFill.Blip = new CT_Blip(); this.Picture.BlipFill.Blip.Cstate_Attr = ST_BlipCompression.print; this.Picture.BlipFill.Choice_0 = CT_BlipFillProperties.ChoiceBucket_0.stretch; this.Picture.BlipFill.Stretch = new CT_StretchInfoProperties(); this.Picture.BlipFill.Stretch.FillRect = new CT_RelativeRect(); this.Picture.SpPr.Choice_0 = CT_ShapeProperties.ChoiceBucket_0.prstGeom; this.Picture.SpPr.PrstGeom = new CT_PresetGeometry2D(); this.Picture.SpPr.PrstGeom.Prst_Attr = ST_ShapeType.rect; this.Picture.SpPr.PrstGeom.AvLst = new CT_GeomGuideList(); }