private void ReadLabel(XRLabel xtraControl, StiContainer parent) { StiText text = new StiText(); parent.Components.Add(text); ReadComp(xtraControl, text); text.Angle = xtraControl.Angle; text.AutoWidth = xtraControl.AutoWidth; ReadBrush(xtraControl, text); ReadTextBrush(xtraControl, text); ReadBorder(xtraControl, text); ReadFont(xtraControl, text); ReadTextAlignment(xtraControl, text); text.WordWrap = xtraControl.WordWrap; #region ProcessDuplicates switch (xtraControl.ProcessDuplicates) { case ValueSuppressType.Leave: text.ProcessingDuplicates = StiProcessingDuplicatesType.None; break; case ValueSuppressType.Suppress: text.ProcessingDuplicates = StiProcessingDuplicatesType.Hide; break; case ValueSuppressType.SuppressAndShrink: text.ProcessingDuplicates = StiProcessingDuplicatesType.Merge; break; } #endregion #region ProcessNullValues text.HideZeros = xtraControl.ProcessNullValues == ValueSuppressType.Suppress || xtraControl.ProcessNullValues == ValueSuppressType.SuppressAndShrink; #endregion text.Text.Value = xtraControl.Text; foreach (XRBinding bind in xtraControl.DataBindings) { switch (bind.PropertyName) { case "Text": text.Text.Value = "{" + ParseExpression(bind.DataMember) + "}"; break; case "Bookmark": text.Bookmark.Value = "{" + ParseExpression(bind.DataMember) + "}"; break; case "Hyperlink": text.Hyperlink.Value = "{" + ParseExpression(bind.DataMember) + "}"; break; } } }
private void ReadCheckBox(XRCheckBox xtraControl, StiContainer parent) { #region Read CheckBox StiCheckBox check = new StiCheckBox(); parent.Components.Add(check); ReadComp(xtraControl, check); ReadBrush(xtraControl, check); ReadTextBrush(xtraControl, check); ReadBorder(xtraControl, check); ReadFont(xtraControl, check); check.Width = check.Height; #endregion #region Read Text StiText text = new StiText(); parent.Components.Add(text); ReadComp(xtraControl, text); text.Name += "_Text"; text.Left += check.Width; text.Width -= check.Width; ReadBrush(xtraControl, text); ReadTextBrush(xtraControl, text); ReadBorder(xtraControl, text); ReadFont(xtraControl, text); ReadTextAlignment(xtraControl, text); text.Text.Value = xtraControl.Text; #endregion }
private void ReadSubreportObject(XmlNode node, StiContainer parent) { StiSubReport subReport = new StiSubReport(); parent.Components.Add(subReport); ReadComp(node, subReport); }
/// <summary> /// Rendering of the component without events. /// </summary> /// <param name="renderedComponent">Rendered component.</param> /// <param name="outContainer">Panel in which rendering will be done.</param> /// <returns>Is rendering finished or not.</returns> protected override bool RenderComponent(ref StiComponent renderedComponent, StiContainer outContainer) { MyCustomComponent component = (MyCustomComponent)this.Clone(); component.InvokeEvents(); outContainer.Components.Add(component); renderedComponent = component; return(true); }
private void ReadPanel(XRPanel xtraControl, StiContainer parent) { StiPanel panel = new StiPanel(); parent.Components.Add(panel); ReadComp(xtraControl, panel); ProcessControls(xtraControl.Controls, panel); }
private void ReadTableRow(XRTableRow xtraControl, StiContainer parent) { StiPanel tableRow = new StiPanel(); parent.Components.Add(tableRow); ReadComp(xtraControl, tableRow); ProcessControls(xtraControl.Controls, tableRow); }
private void ReadBarCode(XRBarCode xtraControl, StiContainer parent) { StiBarCode barCode = new StiBarCode(); parent.Components.Add(barCode); ReadComp(xtraControl, barCode); ReadBorder(xtraControl, barCode); ReadFont(xtraControl, barCode); ReadTextBrush(xtraControl, barCode); }
private void DrawTitleB(StiContainer content, DateTime startDate, DateTime endDate, double dynamicWidth) { double left = 0, top = 0, basicHeight = .2; var border = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid); var artistText = new StiText(new RectangleD(left, top, 1.2, basicHeight)) { Text = "作家", Font = new Font("Meiryo", 6), Border = border, HorAlignment = StiTextHorAlignment.Center, VertAlignment = StiVertAlignment.Center }; content.Components.Add(artistText); left += 1.2; for (var date = startDate; date.Date <= endDate.Date; date = date.AddDays(1)) { var dateText = new StiText(new RectangleD(left, top, dynamicWidth * 3, basicHeight)) { Text = date.ToString(Constants.ExactMonthDayFormatJP), Font = new Font("Meiryo", 6), Border = border, HorAlignment = StiTextHorAlignment.Center, VertAlignment = StiVertAlignment.Center }; content.Components.Add(dateText); left += dateText.Width; } var totalOfContractArtist = new StiText(new RectangleD(left, top, .6, basicHeight)) { Text = "本数", Font = new Font("Meiryo", 6), Border = border, HorAlignment = StiTextHorAlignment.Center, VertAlignment = StiVertAlignment.Center }; content.Components.Add(totalOfContractArtist); left += .6; var subTotalArtist = new StiText(new RectangleD(left, top, 1.1, basicHeight)) { Text = "小計", Font = new Font("Meiryo", 6), Border = border, HorAlignment = StiTextHorAlignment.Center, VertAlignment = StiVertAlignment.Center }; content.Components.Add(subTotalArtist); }
private void ReadRichText(XRRichText xtraControl, StiContainer parent) { StiRichText richBox = new StiRichText(); parent.Components.Add(richBox); ReadComp(xtraControl, richBox); ReadBrush(xtraControl, richBox); ReadTextBrush(xtraControl, richBox); ReadBorder(xtraControl, richBox); ReadFont(xtraControl, richBox); }
private void ProcessControls(XRControlCollection controls, StiContainer parent) { foreach (XRControl control in controls) { if (control is XRLabel) { ReadLabel(control as XRLabel, parent); } else if (control is XRPageInfo) { ReadPageInfo(control as XRPageInfo, parent); } else if (control is XRCheckBox) { ReadCheckBox(control as XRCheckBox, parent); } else if (control is XRPictureBox) { ReadPictureBox(control as XRPictureBox, parent); } else if (control is XRRichText) { ReadRichText(control as XRRichText, parent); } else if (control is XRPanel) { ReadPanel(control as XRPanel, parent); } else if (control is XRLine) { ReadLine(control as XRLine, parent); } else if (control is XRShape) { ReadShape(control as XRShape, parent); } else if (control is XRBarCode) { ReadBarCode(control as XRBarCode, parent); } else if (control is XRTable) { ReadTable(control as XRTable, parent); } else if (control is XRTableRow) { ReadTableRow(control as XRTableRow, parent); } } }
private void ReadLine(XRLine xtraControl, StiContainer parent) { StiShape shape = new StiShape(); parent.Components.Add(shape); ReadComp(xtraControl, shape); ReadBrush(xtraControl, shape); ReadTextBrush(xtraControl, shape); ReadBorder(xtraControl, shape); #region LineDirection switch (xtraControl.LineDirection) { case LineDirection.BackSlant: shape.ShapeType = new StiDiagonalDownLineShapeType(); break; case LineDirection.Slant: shape.ShapeType = new StiDiagonalUpLineShapeType(); break; case LineDirection.Horizontal: shape.ShapeType = new StiHorizontalLineShapeType(); break; case LineDirection.Vertical: shape.ShapeType = new StiVerticalLineShapeType(); break; } #endregion shape.Style = ConvertBorderDashStyle(xtraControl.LineStyle); shape.Size = xtraControl.LineWidth; shape.BorderColor = xtraControl.ForeColor; }
private void ReadPictureBox(XRPictureBox xtraControl, StiContainer parent) { StiImage image = new StiImage(); parent.Components.Add(image); ReadComp(xtraControl, image); ReadBrush(xtraControl, image); ReadTextBrush(xtraControl, image); ReadBorder(xtraControl, image); ReadFont(xtraControl, image); image.ImageURL.Value = xtraControl.ImageUrl; image.Image = xtraControl.Image; #region Sizing switch (xtraControl.Sizing) { case DevExpress.XtraPrinting.ImageSizeMode.AutoSize: case DevExpress.XtraPrinting.ImageSizeMode.StretchImage: image.Stretch = true; break; case DevExpress.XtraPrinting.ImageSizeMode.CenterImage: image.HorAlignment = StiHorAlignment.Center; image.VertAlignment = StiVertAlignment.Center; break; case DevExpress.XtraPrinting.ImageSizeMode.ZoomImage: image.AspectRatio = true; image.Stretch = true; break; } #endregion }
private void ReadShape(XRShape xtraControl, StiContainer parent) { StiShape shape = new StiShape(); parent.Components.Add(shape); ReadComp(xtraControl, shape); ReadBorder(xtraControl, shape); #region Shape if (xtraControl.Shape is ShapeRectangle) { shape.ShapeType = new StiRectangleShapeType(); } else if (xtraControl.Shape is ShapeArrow) { shape.ShapeType = new StiArrowShapeType(); } else if (xtraControl.Shape is ShapeCross) { shape.ShapeType = new StiPlusShapeType(); } else if (xtraControl.Shape is ShapeEllipse) { shape.ShapeType = new StiOvalShapeType(); } else if (xtraControl.Shape is ShapeLine) { shape.ShapeType = new StiHorizontalLineShapeType(); } #endregion shape.Size = xtraControl.LineWidth; shape.BorderColor = xtraControl.ForeColor; shape.Brush = new StiSolidBrush(xtraControl.FillColor); }
public override bool InternalRender(StiComponent masterComp, ref StiComponent renderedComponent, StiContainer outContainer) { bool result = base.InternalRender(masterComp, ref renderedComponent, outContainer); return(result); }
private void ReadPageInfo(XRPageInfo xtraControl, StiContainer parent) { StiText text = new StiText(); parent.Components.Add(text); ReadComp(xtraControl, text); ReadBrush(xtraControl, text); ReadTextBrush(xtraControl, text); ReadBorder(xtraControl, text); ReadFont(xtraControl, text); ReadTextAlignment(xtraControl, text); #region ProcessDuplicates switch (xtraControl.ProcessDuplicates) { case ValueSuppressType.Leave: text.ProcessingDuplicates = StiProcessingDuplicatesType.None; break; case ValueSuppressType.Suppress: text.ProcessingDuplicates = StiProcessingDuplicatesType.Hide; break; case ValueSuppressType.SuppressAndShrink: text.ProcessingDuplicates = StiProcessingDuplicatesType.Merge; break; } #endregion #region ProcessNullValues text.HideZeros = xtraControl.ProcessNullValues == ValueSuppressType.Suppress || xtraControl.ProcessNullValues == ValueSuppressType.SuppressAndShrink; #endregion text.Text.Value = xtraControl.Text; #region PageInfo switch (xtraControl.PageInfo) { case DevExpress.XtraPrinting.PageInfo.DateTime: text.Text.Value = "{Today}"; text.TextFormat = new StiDateFormatService(); break; case DevExpress.XtraPrinting.PageInfo.Number: text.Text.Value = "{PageNumber}"; break; case DevExpress.XtraPrinting.PageInfo.NumberOfTotal: text.Text.Value = "{PageNumber}/{TotalPageCount}"; break; case DevExpress.XtraPrinting.PageInfo.RomLowNumber: text.Text.Value = "{ToLowerCase(Roman(PageNumber))}"; break; case DevExpress.XtraPrinting.PageInfo.RomHiNumber: text.Text.Value = "{ToLowerCase(Roman(PageNumber))}"; break; case DevExpress.XtraPrinting.PageInfo.UserName: text.Text.Value = "{ReportAuthor}"; break; } #endregion }