Browse Source

Textbased Items now use the same code for ContentAlignment and drawing in the designer and in printing. Better handling of Row Items

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1354 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 20 years ago
parent
commit
d2c4e4c562
  1. 4
      src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSection.cs
  2. 43
      src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportTextControl.cs
  3. 14
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ItemsHelper.cs
  4. 10
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportDataItem.cs
  5. 31
      src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportTextItem.cs
  6. 9
      src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs
  7. 9
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs
  8. 16
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs
  9. 146
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs
  10. 14
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs
  11. 92
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/TextDrawer.cs
  12. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs
  13. 4
      src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlHelper.cs

4
src/AddIns/Misc/SharpReport/SharpReport/Designer/SectionControls/ReportSection.cs

@ -248,7 +248,7 @@ namespace SharpReport{ @@ -248,7 +248,7 @@ namespace SharpReport{
}
private void OnItemAddeded(object sender, CollectionItemEventArgs<IItemRenderer> e){
SharpReport.Designer.IDesignable iDesignable = e.Item as SharpReport.Designer.IDesignable;
if (iDesignable != null) {
@ -259,7 +259,7 @@ namespace SharpReport{ @@ -259,7 +259,7 @@ namespace SharpReport{
iDesignable.VisualControl.Focus();
iDesignable.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler (OnPropertyChanged);
}
}
}
}
private void OnRemoveTopLevelItem(object sender, CollectionItemEventArgs<IItemRenderer> e){

43
src/AddIns/Misc/SharpReport/SharpReport/Designer/VisualControls/ReportTextControl.cs

@ -18,7 +18,11 @@ namespace SharpReport.Designer{ @@ -18,7 +18,11 @@ namespace SharpReport.Designer{
/// Description of ReportTextItem.
/// </summary>
internal class ReportTextControl : ReportControlBase{
StringFormat stringFormat;
private StringTrimming stringTrimming;
private ContentAlignment contentAlignment;
TextDrawer textDrawer = new TextDrawer();
public ReportTextControl():base(){
InitializeComponent();
@ -37,31 +41,31 @@ namespace SharpReport.Designer{ @@ -37,31 +41,31 @@ namespace SharpReport.Designer{
public override string Text{
get { return base.Text; }
set {
base.Text = value;
}
set { base.Text = value;}
}
public StringFormat StringFormat{
public StringTrimming StringTrimming {
set {
if (this.stringFormat != value) {
this.stringFormat = value;
this.Invalidate();
}
stringTrimming = value;
this.Invalidate();
}
}
public System.Drawing.ContentAlignment ContentAlignment {
set {
this.contentAlignment = value;
this.Invalidate();
}
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pea){
base.OnPaint(pea);
base.DrawEdges (pea);
base.DrawDecorations(pea);
if (this.stringFormat == null) {
this.stringFormat = GlobalValues.StandartStringFormat();
this.stringFormat.LineAlignment = StringAlignment.Center;
}
string str;
if (String.IsNullOrEmpty(this.Text)) {
@ -70,10 +74,9 @@ namespace SharpReport.Designer{ @@ -70,10 +74,9 @@ namespace SharpReport.Designer{
str = this.Text;
}
pea.Graphics.DrawString(str,this.Font,
new SolidBrush(this.ForeColor),
(RectangleF)this.ClientRectangle,
this.stringFormat);
this.textDrawer.DrawString (pea.Graphics,this.Text,this.Font,
new SolidBrush(this.ForeColor),(RectangleF)this.ClientRectangle,
this.stringTrimming,this.contentAlignment);
}

14
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ItemsHelper.cs

@ -20,10 +20,10 @@ namespace SharpReport { @@ -20,10 +20,10 @@ namespace SharpReport {
/// created by - Forstmeier Peter
/// created on - 31.08.2005 13:49:47
/// </remarks>
public class ItemsHelper : object {
internal class ItemsHelper : object {
public static void UpdateBaseFromTextControl (ReportObjectControlBase control,
internal static void UpdateBaseFromTextControl (ReportObjectControlBase control,
BaseReportItem item) {
item.Size = control.Size;
@ -32,9 +32,10 @@ namespace SharpReport { @@ -32,9 +32,10 @@ namespace SharpReport {
item.BackColor = control.BackColor;
item.ForeColor = control.ForeColor;
item.Font = control.Font;
}
public static void UpdateBaseFromGraphicControl (AbstractGraphicControl control,
internal static void UpdateBaseFromGraphicControl (AbstractGraphicControl control,
BaseGraphicItem item) {
ItemsHelper.UpdateBaseFromTextControl (control,item);
@ -43,7 +44,7 @@ namespace SharpReport { @@ -43,7 +44,7 @@ namespace SharpReport {
}
public static void UpdateControlFromTextBase (ReportObjectControlBase control,
internal static void UpdateControlFromTextBase (ReportObjectControlBase control,
BaseReportItem item) {
control.BackColor = item.BackColor;
@ -53,13 +54,10 @@ namespace SharpReport { @@ -53,13 +54,10 @@ namespace SharpReport {
control.Font = item.Font;
control.Name = item.Name;
BaseTextItem b = item as BaseTextItem;
// if (b != null) {
// control. = b.StringAlignment;
// }
}
public static void UpdateControlFromGraphicBase (AbstractGraphicControl control,
internal static void UpdateControlFromGraphicBase (AbstractGraphicControl control,
BaseGraphicItem item) {
ItemsHelper.UpdateControlFromTextBase(control,item);
control.Location = item.Location;

10
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportDataItem.cs

@ -38,9 +38,12 @@ namespace SharpReport.ReportItems{ @@ -38,9 +38,12 @@ namespace SharpReport.ReportItems{
visualControl = new ReportDbTextControl();
this.visualControl.Text = base.ColumnName;
visualControl.StringFormat = base.StringFormat;
this.Text = base.ColumnName;
visualControl.ContentAlignment = base.ContentAlignment;
visualControl.StringTrimming = base.StringTrimming;
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.visualControl.Click += new EventHandler(OnControlSelect);
@ -65,7 +68,10 @@ namespace SharpReport.ReportItems{ @@ -65,7 +68,10 @@ namespace SharpReport.ReportItems{
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this);
this.visualControl.StringFormat = base.StringFormat;
this.visualControl.ContentAlignment = base.ContentAlignment;
this.visualControl.StringTrimming = base.StringTrimming;
this.HandlePropertyChanged(e.PropertyName);
}

31
src/AddIns/Misc/SharpReport/SharpReport/ReportItems/TextBased/ReportTextItem.cs

@ -32,16 +32,17 @@ namespace SharpReport.ReportItems { @@ -32,16 +32,17 @@ namespace SharpReport.ReportItems {
visualControl = new ReportTextControl();
this.Text = visualControl.Name;
visualControl.StringFormat = base.StringFormat;
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
visualControl.ContentAlignment = base.ContentAlignment;
visualControl.StringTrimming = base.StringTrimming;
ItemsHelper.UpdateBaseFromTextControl (this.visualControl,this);
this.visualControl.Click += new EventHandler(OnControlSelect);
this.visualControl.VisualControlChanged += new EventHandler (OnControlChanged);
this.visualControl.BackColorChanged += new EventHandler (OnControlChanged);
this.visualControl.FontChanged += new EventHandler (OnControlChanged);
this.visualControl.ForeColorChanged += new EventHandler (OnControlChanged);
base.PropertyChanged += new PropertyChangedEventHandler (BasePropertyChange);
}
@ -49,11 +50,14 @@ namespace SharpReport.ReportItems { @@ -49,11 +50,14 @@ namespace SharpReport.ReportItems {
#endregion
#region events
private void BasePropertyChange (object sender, PropertyChangedEventArgs e){
ItemsHelper.UpdateControlFromTextBase(this.visualControl,this);
this.visualControl.StringFormat = base.StringFormat;
this.visualControl.ContentAlignment = base.ContentAlignment;
this.visualControl.StringTrimming = base.StringTrimming;
this.HandlePropertyChanged(e.PropertyName);
}
@ -86,20 +90,7 @@ namespace SharpReport.ReportItems { @@ -86,20 +90,7 @@ namespace SharpReport.ReportItems {
}
#endregion
public override Size Size {
get {
return base.Size;
}
set {
base.Size = value;
if (this.visualControl != null) {
this.visualControl.Size = value;
}
this.HandlePropertyChanged("Size");
}
}
public override Point Location {
get {
return base.Location;
@ -142,7 +133,7 @@ namespace SharpReport.ReportItems { @@ -142,7 +133,7 @@ namespace SharpReport.ReportItems {
this.HandlePropertyChanged("Text");
}
}
#region IDesignable
[System.Xml.Serialization.XmlIgnoreAttribute]

9
src/AddIns/Misc/SharpReport/SharpReport/Visitors/LoadReportVisitor.cs

@ -115,7 +115,10 @@ namespace SharpReport.Visitors { @@ -115,7 +115,10 @@ namespace SharpReport.Visitors {
itemRenderer = designableFactory.Create(ctrlElem.GetAttribute("type"));
baseReportItem = (BaseReportItem)itemRenderer;
baseReportItem.SuspendLayout();
XmlHelper.SetReportItemValues (base.XmlFormReader,ctrlElem,baseReportItem);
if (parentContainer == null) {
baseReportItem.Parent = baseSection;
baseSection.Items.Add (baseReportItem);
@ -124,9 +127,7 @@ namespace SharpReport.Visitors { @@ -124,9 +127,7 @@ namespace SharpReport.Visitors {
parentContainer.Items.Add(baseReportItem);
}
XmlHelper.SetReportItemValues (base.XmlFormReader,ctrlElem,baseReportItem);
baseReportItem.ResumeLayout();
IContainerItem iContainer = baseReportItem as IContainerItem;
if (iContainer != null) {

9
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs

@ -66,11 +66,10 @@ namespace SharpReportCore { @@ -66,11 +66,10 @@ namespace SharpReportCore {
// this.DbValue is formatted in the BeforePrintEvent catched in AbstractRenderer
string toPrint = CheckForNullValue();
string formattedString = base.FireFormatOutput(toPrint,this.FormatString,"");
RectangleF rect = base.PrepareRectangle (rpea,formattedString);
base.PrintTheStuff (rpea,formattedString,rect);
base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
base.Text = base.FireFormatOutput(toPrint,this.FormatString,"");
base.Render (rpea);
}
public override string ToString() {

16
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs

@ -60,14 +60,17 @@ namespace SharpReportCore { @@ -60,14 +60,17 @@ namespace SharpReportCore {
#endregion
#region EventHandling
protected void NotiyfyAfterPrint (PointF afterPrintLocation) {
// System.Console.WriteLine("\tNotiyfyAfterPrint");
if (this.ItemPrinted != null) {
AfterPrintEventArgs rea = new AfterPrintEventArgs (afterPrintLocation);
ItemPrinted(this, rea);
}
}
protected void NotifyBeforePrint () {
private void NotifyBeforePrint () {
// System.Console.WriteLine("\tNotifyBeforePrint");
if (this.ItemPrinting != null) {
BeforePrintEventArgs ea = new BeforePrintEventArgs ();
ItemPrinting (this,ea);
@ -75,6 +78,15 @@ namespace SharpReportCore { @@ -75,6 +78,15 @@ namespace SharpReportCore {
}
#endregion
#region overrides
public override void Render(ReportPageEventArgs rpea){
base.Render(rpea);
this.NotifyBeforePrint();
}
#endregion
#region virtual method's
protected RectangleF DrawingRectangle (ReportPageEventArgs e,SizeF measureSize) {
@ -145,7 +157,7 @@ namespace SharpReportCore { @@ -145,7 +157,7 @@ namespace SharpReportCore {
NotifyPropertyChanged ("Font");
}
}
#endregion
#region IDisposeable

146
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs

@ -32,6 +32,7 @@ namespace SharpReportCore { @@ -32,6 +32,7 @@ namespace SharpReportCore {
private ContentAlignment contentAlignment;
#region Constructor
public BaseTextItem():base() {
this.stringFormat = StringFormat.GenericTypographic;
this.contentAlignment = ContentAlignment.MiddleLeft;
@ -40,85 +41,19 @@ namespace SharpReportCore { @@ -40,85 +41,19 @@ namespace SharpReportCore {
#endregion
private StringFormat BuildStringFormat(){
StringFormat format = StringFormat.GenericTypographic;
format.Trimming = this.stringTrimming;
format.FormatFlags = StringFormatFlags.LineLimit;
// if (base.RightToLeft)
// {
// format1.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
// }
ContentAlignment alignment = this.contentAlignment;
if (alignment <= ContentAlignment.MiddleCenter){
switch (alignment){
case ContentAlignment.TopLeft:{
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Near;
return format;
}
case ContentAlignment.TopCenter:{
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Near;
return format;
}
case (ContentAlignment.TopCenter | ContentAlignment.TopLeft):{
return format;
}
case ContentAlignment.TopRight:{
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Near;
return format;
}
case ContentAlignment.MiddleLeft:{
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Center;
return format;
}
case ContentAlignment.MiddleCenter:{
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Center;
return format;
}
}
return format;
}
if (alignment <= ContentAlignment.BottomLeft){
if (alignment == ContentAlignment.MiddleRight){
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Center;
return format;
}
if (alignment != ContentAlignment.BottomLeft){
return format;
}
}
else{
if (alignment != ContentAlignment.BottomCenter){
if (alignment == ContentAlignment.BottomRight)
{
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Far;
}
return format;
}
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Far;
return format;
}
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Far;
return format;
}
public override void Render(ReportPageEventArgs rpea) {
if (rpea == null) {
throw new ArgumentNullException("rpea");
}
base.Render(rpea);
RectangleF rect = PrepareRectangle (rpea,this.Text);
FillBackGround (rpea.PrintPageEventArgs.Graphics,
rect);
DrawFrame (rpea.PrintPageEventArgs.Graphics,
Rectangle.Ceiling (rect));
PrintTheStuff (rpea,this.Text,rect);
base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
}
@ -127,22 +62,29 @@ namespace SharpReportCore { @@ -127,22 +62,29 @@ namespace SharpReportCore {
return "BaseTextItem";
}
private void Decorate (ReportPageEventArgs rpea,Rectangle border) {
protected void FillBackGround (Graphics graphics,RectangleF rectangle) {
using (SolidBrush brush = new SolidBrush(base.BackColor)) {
rpea.PrintPageEventArgs.Graphics.FillRectangle(brush,border);
graphics.FillRectangle(brush,rectangle);
}
}
protected void DrawFrame (Graphics graphics,Rectangle border) {
if (base.DrawBorder == true) {
using (Pen pen = new Pen(Color.Black, 1)) {
rpea.PrintPageEventArgs.Graphics.DrawRectangle (pen,border);
graphics.DrawRectangle (pen,border);
}
//TODO use this class to draw a border
// RectangleShape shape = new RectangleShape();
// shape.DrawShape (graphics,
// new BaseLine (this.ForeColor,System.Drawing.Drawing2D.DashStyle.Solid,1),
// border);
}
}
protected RectangleF PrepareRectangle (ReportPageEventArgs e,string text) {
protected RectangleF PrepareRectangle (ReportPageEventArgs rpea,string text) {
SizeF measureSize = new SizeF ();
measureSize = MeasureReportItem (e,text);
RectangleF rect = base.DrawingRectangle (e,measureSize);
Decorate (e,System.Drawing.Rectangle.Ceiling (rect));
measureSize = MeasureReportItem (rpea,text);
RectangleF rect = base.DrawingRectangle (rpea,measureSize);
return rect;
}
@ -172,20 +114,31 @@ namespace SharpReportCore { @@ -172,20 +114,31 @@ namespace SharpReportCore {
RectangleF rectangle ) {
if (rpea == null) {
throw new ArgumentException (this.Name);
throw new ArgumentNullException("rpea");
}
StringFormat fmt = this.stringFormat;
textDrawer.DrawString(rpea.PrintPageEventArgs.Graphics,
toPrint,
this.Font,
toPrint,this.Font,
new SolidBrush(this.ForeColor),
rectangle,
fmt);
rpea.LocationAfterDraw = new PointF (this.Location.X + this.Size.Width,
this.stringTrimming,this.contentAlignment);
rpea.LocationAfterDraw = new PointF (this.Location.X + this.Size.Width,
this.Location.Y + this.Size.Height);
}
public virtual string Text {
get {
return text;
}
set {
text = value;
base.NotifyPropertyChanged("Text");
}
}
///<summary>
/// Formatstring like in MSDN
/// </summary>
@ -204,20 +157,8 @@ namespace SharpReportCore { @@ -204,20 +157,8 @@ namespace SharpReportCore {
}
public virtual string Text {
get {
return text;
}
set {
text = value;
base.NotifyPropertyChanged("Text");
}
}
[Category("Appearance")]
public StringTrimming StringTrimming {
public StringTrimming StringTrimming {
get {
return stringTrimming;
}
@ -237,12 +178,13 @@ namespace SharpReportCore { @@ -237,12 +178,13 @@ namespace SharpReportCore {
base.NotifyPropertyChanged("ContentAlignment");
}
}
[Browsable(false)]
[XmlIgnoreAttribute]
public StringFormat StringFormat {
public virtual StringFormat StringFormat {
get {
return this.BuildStringFormat();
return this.textDrawer.BuildStringFormat (this.StringTrimming,
this.ContentAlignment);
}
}
}

14
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/RowItem.cs

@ -23,7 +23,7 @@ namespace SharpReportCore{ @@ -23,7 +23,7 @@ namespace SharpReportCore{
private ReportItemCollection items;
private Padding padding;
private Color secondaryBackColor;
private Color alternateBackColor;
private int changeBackColorEveryNRow;
public RowItem():this (String.Empty){
@ -64,7 +64,8 @@ namespace SharpReportCore{ @@ -64,7 +64,8 @@ namespace SharpReportCore{
if (rpea == null) {
throw new ArgumentNullException("rpea");
}
System.Console.WriteLine("");
System.Console.WriteLine("--Start Row Item");
base.Render(rpea);
RectangleF rect = PrepareRectangle (rpea);
@ -79,7 +80,8 @@ namespace SharpReportCore{ @@ -79,7 +80,8 @@ namespace SharpReportCore{
childItem.Render (rpea);
childItem.Location = new Point(loc.X,loc.Y);
}
System.Console.WriteLine("--End of RowItem");
System.Console.WriteLine("");
base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
}
@ -96,12 +98,12 @@ namespace SharpReportCore{ @@ -96,12 +98,12 @@ namespace SharpReportCore{
[Category("Appearance"),
Description("Change the Backcolor on every 'N' Row")]
public Color SecondaryBackColor {
public Color AlternateBackColor {
get {
return this.secondaryBackColor;
return this.alternateBackColor;
}
set {
this.secondaryBackColor = value;
this.alternateBackColor = value;
base.NotifyPropertyChanged("SecondaryBackColor");
}
}

92
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/TextDrawer.cs

@ -38,12 +38,102 @@ namespace SharpReportCore { @@ -38,12 +38,102 @@ namespace SharpReportCore {
}
public void DrawString(Graphics graphics,string text,Font font,Brush brush,RectangleF rectangle,StringFormat stringFormat) {
public void DrawString(Graphics graphics,string text,
Font font,Brush brush,
RectangleF rectangle,
StringFormat stringFormat) {
graphics.DrawString(text,
font,
brush,
rectangle,
stringFormat);
}
public void DrawString(Graphics graphics,string text,
Font font,Brush brush,
RectangleF rectangle,
StringTrimming stringTrimming,
ContentAlignment alignment) {
StringFormat s = BuildStringFormat(stringTrimming,alignment);
this.DrawString(graphics,text,
font,brush,
rectangle,
s);
}
public StringFormat BuildStringFormat(StringTrimming stringTrimming,ContentAlignment alignment){
StringFormat format = StringFormat.GenericTypographic;
format.Trimming = stringTrimming;
format.FormatFlags = StringFormatFlags.LineLimit;
// if (base.RightToLeft)
// {
// format1.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
// }
if (alignment <= ContentAlignment.MiddleCenter){
switch (alignment){
case ContentAlignment.TopLeft:{
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Near;
return format;
}
case ContentAlignment.TopCenter:{
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Near;
return format;
}
case (ContentAlignment.TopCenter | ContentAlignment.TopLeft):{
return format;
}
case ContentAlignment.TopRight:{
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Near;
return format;
}
case ContentAlignment.MiddleLeft:{
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Center;
return format;
}
case ContentAlignment.MiddleCenter:{
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Center;
return format;
}
}
return format;
}
if (alignment <= ContentAlignment.BottomLeft){
if (alignment == ContentAlignment.MiddleRight){
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Center;
return format;
}
if (alignment != ContentAlignment.BottomLeft){
return format;
}
}
else{
if (alignment != ContentAlignment.BottomCenter){
if (alignment == ContentAlignment.BottomRight)
{
format.Alignment = StringAlignment.Far;
format.LineAlignment = StringAlignment.Far;
}
return format;
}
format.Alignment = StringAlignment.Center;
format.LineAlignment = StringAlignment.Far;
return format;
}
format.Alignment = StringAlignment.Near;
format.LineAlignment = StringAlignment.Far;
return format;
}
}
}

2
src/AddIns/Misc/SharpReport/SharpReportCore/ReportSettings.cs

@ -48,7 +48,7 @@ namespace SharpReportCore{ @@ -48,7 +48,7 @@ namespace SharpReportCore{
private System.Data.CommandType commandType;
private Font defaultFont = new Font("Microsoft Sans Serif",
16,
10,
FontStyle.Regular,
GraphicsUnit.Point);

4
src/AddIns/Misc/SharpReport/SharpReportCore/Xml/XmlHelper.cs

@ -121,6 +121,7 @@ namespace SharpReportCore { @@ -121,6 +121,7 @@ namespace SharpReportCore {
XmlElement ctrlElem,
BaseReportItem item) {
item.SuspendLayout();
try {
XmlNodeList nodeList = ctrlElem.ChildNodes;
foreach (XmlNode node in nodeList) {
@ -130,7 +131,6 @@ namespace SharpReportCore { @@ -130,7 +131,6 @@ namespace SharpReportCore {
if (elem.Name == "Font") {
item.Font = XmlFormReader.MakeFont (elem.GetAttribute("value"));
}
reader.SetValue (item,
elem.Name,elem.GetAttribute("value"));
}
@ -138,6 +138,8 @@ namespace SharpReportCore { @@ -138,6 +138,8 @@ namespace SharpReportCore {
}
} catch (Exception) {
throw;
} finally {
item.ResumeLayout();
}
}
}

Loading…
Cancel
Save