Browse Source

Fixed http://community.sharpdevelop.net/forums/thread/9098.aspx and broken build as well

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1523 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Peter Forstmeier 20 years ago
parent
commit
b69e3277b2
  1. 81
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/DataTypeHelper.cs
  2. 14
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseDataItem.cs
  3. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseFunction.cs
  4. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseReportItem.cs
  5. 20
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseTextItem.cs
  6. 21
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs
  7. 53
      src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs
  8. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs
  9. 18
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs
  10. 2
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs
  11. 190
      src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs
  12. 3
      src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj

81
src/AddIns/Misc/SharpReport/SharpReportCore/BaseClasses/DataTypeHelper.cs

@ -0,0 +1,81 @@
/*
* Created by SharpDevelop.
* User: Forstmeier Helmut
* Date: 27.06.2006
* Time: 09:12
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
namespace SharpReportCore
{
/// <summary>
/// Description of DataType.
/// </summary>
internal class DataTypeHelper{
//TODO why not use
// TypeCode tc = Type.GetTypeCode( Type.GetType("System.String"));
internal static TypeCode TypeCodeFromString (string type) {
TypeCode tc;
if (type == null) {
type = "System.String";
}
if (type.StartsWith("System.")){
type = type.Substring(7);
}
switch (type){
case "DateTime":
tc = TypeCode.DateTime;
break;
case "Boolean":
tc = TypeCode.Boolean;
break;
case "String":
case "Char":
tc = TypeCode.String;
break;
case "Decimal":
tc = TypeCode.Decimal;
break;
case "Integer":
case "Int16":
case "Int32":
tc = TypeCode.Int32;
break;
case "Float":
case "Single":
case "Double":
tc = TypeCode.Double;
break;
default:
tc = TypeCode.Object;
break;
}
return tc;
}
static internal bool IsNumber(TypeCode tc){
switch (tc){
case TypeCode.Int32:
case TypeCode.Double:
case TypeCode.Decimal:
return true;
default: // user error
return false;
}
}
}
}

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

@ -33,13 +33,16 @@ namespace SharpReportCore {
private string dataType; private string dataType;
private string nullValue; private string nullValue;
#region Constructor #region Constructor
public BaseDataItem():base() { public BaseDataItem():base() {
this.dataType = "System.String";
} }
public BaseDataItem(string columnName):base(){ public BaseDataItem(string columnName):base(){
this.columnName = columnName; this.columnName = columnName;
this.dataType = "System.String";
} }
#endregion #endregion
@ -63,12 +66,17 @@ namespace SharpReportCore {
public override void Render(SharpReportCore.ReportPageEventArgs rpea) { public override void Render(SharpReportCore.ReportPageEventArgs rpea) {
// this.DbValue is formatted in the BeforePrintEvent catched in AbstractRenderer // TypeCode tc = Type.GetTypeCode( Type.GetType(this.dataType));
// TODO this.DbValue should beformatted in the BeforePrintEvent
string toPrint = CheckForNullValue(); string toPrint = CheckForNullValue();
base.Text = base.FireFormatOutput(toPrint,this.FormatString,"");
// System.Console.WriteLine("\tBaseDataItem <{0}> / <{1}>",this.Name,this.Text); base.Text = base.FormatOutput(toPrint,
this.FormatString,
DataTypeHelper.TypeCodeFromString (this.dataType),
this.nullValue);
base.Render (rpea); base.Render (rpea);
} }

3
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/BaseFunction.cs

@ -26,6 +26,7 @@ namespace SharpReportCore {
public BaseFunction():base() { public BaseFunction():base() {
this.localisedName = "SharpReport.Toolbar.Functions"; this.localisedName = "SharpReport.Toolbar.Functions";
} }
public BaseFunction(string friendlyName) public BaseFunction(string friendlyName)
{ {
this.localisedName = friendlyName; this.localisedName = friendlyName;
@ -38,7 +39,7 @@ namespace SharpReportCore {
#region properties #region properties
[Browsable(false)]
public string LocalisedName { public string LocalisedName {
get { get {
return localisedName; return localisedName;

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

@ -31,7 +31,7 @@ namespace SharpReportCore {
public event EventHandler<BeforePrintEventArgs> ItemPrinting; public event EventHandler<BeforePrintEventArgs> ItemPrinting;
public event EventHandler<AfterPrintEventArgs> ItemPrinted; public event EventHandler<AfterPrintEventArgs> ItemPrinted;
public event EventHandler <FormatOutputEventArgs> FormatOutput; // public event EventHandler <FormatOutputEventArgs> FormatOutput;
public event EventHandler Disposed; public event EventHandler Disposed;
public BaseReportItem() :base(){ public BaseReportItem() :base(){
@ -46,14 +46,14 @@ namespace SharpReportCore {
/// <param name="formatString">the formatString</param> /// <param name="formatString">the formatString</param>
/// <param name="nullValue">Value to return when there is null in toFormat</param> /// <param name="nullValue">Value to return when there is null in toFormat</param>
/// <returns></returns> /// <returns></returns>
protected string FireFormatOutput(string toFormat,string format, string nullValue) { protected string old_FireFormatOutput(string toFormat,string format, string nullValue) {
if (FormatOutput != null) { // if (FormatOutput != null) {
FormatOutputEventArgs ea = new FormatOutputEventArgs (toFormat, // FormatOutputEventArgs ea = new FormatOutputEventArgs (toFormat,
format, // format,
nullValue); // nullValue);
FormatOutput (this,ea); // FormatOutput (this,ea);
return ea.FormatedValue; // return ea.FormatedValue;
} // }
return toFormat; return toFormat;
} }

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

@ -28,20 +28,30 @@ namespace SharpReportCore {
private string formatString = String.Empty; private string formatString = String.Empty;
private StringFormat stringFormat; private StringFormat stringFormat;
private StringTrimming stringTrimming; private StringTrimming stringTrimming;
private TextDrawer textDrawer = new TextDrawer(); private TextDrawer textDrawer;
private StandardFormatter standartFormatter;
private ContentAlignment contentAlignment; private ContentAlignment contentAlignment;
private RectangleShape shape = new RectangleShape(); private RectangleShape shape = new RectangleShape();
#region Constructor #region Constructor
public BaseTextItem():base() { public BaseTextItem():base() {
this.stringFormat = StringFormat.GenericTypographic; this.stringFormat = StringFormat.GenericTypographic;
this.contentAlignment = ContentAlignment.MiddleLeft; this.contentAlignment = ContentAlignment.MiddleLeft;
this.stringTrimming = StringTrimming.EllipsisCharacter; this.stringTrimming = StringTrimming.EllipsisCharacter;
this.textDrawer = new TextDrawer();
this.standartFormatter = new StandardFormatter();
} }
#endregion #endregion
protected string FormatOutput(string valueToFormat,string formatString,
TypeCode typeCode, string nullValue ){
return standartFormatter.FormatItem(valueToFormat,formatString,
typeCode,nullValue);
}
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
@ -164,7 +174,7 @@ namespace SharpReportCore {
} }
[Category("Appearance")] [Category("Appearance")]
public System.Drawing.ContentAlignment ContentAlignment { public virtual System.Drawing.ContentAlignment ContentAlignment {
get { get {
return this.contentAlignment; return this.contentAlignment;
} }

21
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BasePageNumber.cs

@ -33,10 +33,11 @@ namespace SharpReportCore {
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
base.Render(rpea); base.Render(rpea);
string formattedString = base.FireFormatOutput(rpea.PageNumber.ToString(CultureInfo.InvariantCulture), string formattedString = base.FormatOutput(rpea.PageNumber.ToString(CultureInfo.InvariantCulture),
base.FormatString,""); this.FormatString,
TypeCode.Int32,
"xxxx");
RectangleF rect = base.PrepareRectangle (rpea,formattedString); RectangleF rect = base.PrepareRectangle (rpea,formattedString);
//Printout the textpart //Printout the textpart
base.PrintTheStuff (rpea,this.Text,rect); base.PrintTheStuff (rpea,this.Text,rect);
@ -44,13 +45,13 @@ namespace SharpReportCore {
StringFormat fmt = StringFormat; StringFormat fmt = StringFormat;
fmt.Alignment = StringAlignment.Far; fmt.Alignment = StringAlignment.Far;
fmt.LineAlignment = StringAlignment.Near; fmt.LineAlignment = StringAlignment.Center;
rpea.PrintPageEventArgs.Graphics.DrawString(rpea.PageNumber.ToString(CultureInfo.InvariantCulture),
this.Font, rpea.PrintPageEventArgs.Graphics.DrawString(formattedString,
Brushes.Black, this.Font,
rect, Brushes.Black,
fmt); rect,
fmt);
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
} }

53
src/AddIns/Misc/SharpReport/SharpReportCore/BaseItems/Functions/BaseToday.cs

@ -9,6 +9,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using System; using System;
using System.Drawing; using System.Drawing;
using System.ComponentModel;
using System.Globalization; using System.Globalization;
/// <summary> /// <summary>
/// BaseClass for Today's Date /// BaseClass for Today's Date
@ -28,9 +29,17 @@ namespace SharpReportCore {
public override void Render(ReportPageEventArgs rpea) { public override void Render(ReportPageEventArgs rpea) {
base.Render(rpea); base.Render(rpea);
string formattedString = FormatAsDate(System.DateTime.Now.ToString(),base.FormatString);
string f;
if (String.IsNullOrEmpty(this.FormatString)) {
f = "d";
} else {
f = this.FormatString;
}
string formattedString = base.FormatOutput(System.DateTime.Now.ToString(CultureInfo.CurrentCulture),
f,
TypeCode.DateTime,
"");
RectangleF rect = base.PrepareRectangle (rpea,formattedString); RectangleF rect = base.PrepareRectangle (rpea,formattedString);
//Printout the textPart //Printout the textPart
@ -39,42 +48,30 @@ namespace SharpReportCore {
//here we print the functionpart allway's with Stringalignment.Far //here we print the functionpart allway's with Stringalignment.Far
StringFormat fmt = StringFormat; StringFormat fmt = StringFormat;
fmt.Alignment = StringAlignment.Far; fmt.Alignment = StringAlignment.Far;
fmt.LineAlignment = StringAlignment.Near; fmt.LineAlignment = StringAlignment.Center;
rpea.PrintPageEventArgs.Graphics.DrawString(formattedString, rpea.PrintPageEventArgs.Graphics.DrawString(formattedString,
this.Font, this.Font,
Brushes.Black, Brushes.Black,
rect, rect,
fmt); fmt);
// goon // goon
base.NotiyfyAfterPrint (rpea.LocationAfterDraw); base.NotiyfyAfterPrint (rpea.LocationAfterDraw);
} }
public override string ToString() { public override string ToString() {
return "BaseToday"; return "BaseToday";
} }
[Browsable(false)]
#region privates public override ContentAlignment ContentAlignment {
private string FormatAsDate (string toFormat,string formatWith) { get {
if (toFormat.Length == 0) { return base.ContentAlignment;
return String.Empty;
}
if (formatWith.Length == 0) {
return toFormat;
} }
try { set {
DateTime date = DateTime.Parse (toFormat.Trim(), base.ContentAlignment = value;
CultureInfo.CurrentCulture.DateTimeFormat);
string str = date.ToString(formatWith,
DateTimeFormatInfo.CurrentInfo);
return str;
} catch (Exception) {
throw;
} }
} }
#endregion
} }
} }

2
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractDataRenderer.cs

@ -72,7 +72,7 @@ namespace SharpReportCore{
item.Parent = section; item.Parent = section;
} }
item.SectionOffset = section.SectionOffset; item.SectionOffset = section.SectionOffset;
base.DrawSingleItem (rpea,item); item.Render(rpea);
drawPoint.Y = section.SectionOffset + section.Size.Height; drawPoint.Y = section.SectionOffset + section.Size.Height;
rpea.LocationAfterDraw = new PointF (rpea.LocationAfterDraw.X,section.SectionOffset + section.Size.Height); rpea.LocationAfterDraw = new PointF (rpea.LocationAfterDraw.X,section.SectionOffset + section.Size.Height);

18
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/AbstractRenderer.cs

@ -37,7 +37,7 @@ namespace SharpReportCore {
private Point detailStart; private Point detailStart;
private Point detailEnds; private Point detailEnds;
private StandartFormatter standartFormatter; private StandardFormatter standartFormatter;
private bool cancel; private bool cancel;
public event EventHandler<SectionRenderEventArgs> SectionRendering; public event EventHandler<SectionRenderEventArgs> SectionRendering;
@ -50,7 +50,7 @@ namespace SharpReportCore {
this.reportSettings = model.ReportSettings; this.reportSettings = model.ReportSettings;
this.sections = model.SectionCollection; this.sections = model.SectionCollection;
Init(); Init();
standartFormatter = new StandartFormatter(); standartFormatter = new StandardFormatter();
} }
public virtual void SetupRenderer () { public virtual void SetupRenderer () {
@ -276,8 +276,7 @@ namespace SharpReportCore {
item.Parent = this.CurrentSection; item.Parent = this.CurrentSection;
} }
item.SectionOffset = this.CurrentSection.SectionOffset; item.SectionOffset = this.CurrentSection.SectionOffset;
this.DrawSingleItem (rpea,item); item.Render(rpea);
drawPoint.Y = this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height; drawPoint.Y = this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height;
rpea.LocationAfterDraw = new PointF (rpea.LocationAfterDraw.X,this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height); rpea.LocationAfterDraw = new PointF (rpea.LocationAfterDraw.X,this.CurrentSection.SectionOffset + this.CurrentSection.Size.Height);
@ -292,16 +291,9 @@ namespace SharpReportCore {
return drawPoint.Y; return drawPoint.Y;
} }
protected void DrawSingleItem (ReportPageEventArgs rpea,BaseReportItem item){
item.SuspendLayout();
item.FormatOutput -= new EventHandler<FormatOutputEventArgs> (FormatBaseReportItem);
item.FormatOutput += new EventHandler<FormatOutputEventArgs> (FormatBaseReportItem);
item.Render(rpea);
item.ResumeLayout();
}
// Called by FormatOutPutEvent of the BaseReportItem // Called by FormatOutPutEvent of the BaseReportItem
/*
void FormatBaseReportItem (object sender, FormatOutputEventArgs rpea) { void FormatBaseReportItem (object sender, FormatOutputEventArgs rpea) {
BaseDataItem baseDataItem = sender as BaseDataItem; BaseDataItem baseDataItem = sender as BaseDataItem;
@ -314,7 +306,7 @@ namespace SharpReportCore {
} }
} }
} }
*/
#region privates #region privates
protected void FitSectionToItems (BaseSection section,ReportPageEventArgs rpea){ protected void FitSectionToItems (BaseSection section,ReportPageEventArgs rpea){

2
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/RenderDataReport.cs

@ -131,7 +131,7 @@ namespace SharpReportCore {
} }
protected override void PrintReportFooter(object sender, ReportPageEventArgs rpea){ protected override void PrintReportFooter(object sender, ReportPageEventArgs rpea){
System.Console.WriteLine("DataRenderer:PrintReportFooter"); // System.Console.WriteLine("DataRenderer:PrintReportFooter");
base.PrintReportFooter(sender, rpea); base.PrintReportFooter(sender, rpea);
DoReportFooter (new PointF(0,base.CurrentSection.SectionOffset + base.CurrentSection.Size.Height), DoReportFooter (new PointF(0,base.CurrentSection.SectionOffset + base.CurrentSection.Size.Height),
rpea); rpea);

190
src/AddIns/Misc/SharpReport/SharpReportCore/Printing/Text/StandartFormatter.cs

@ -14,162 +14,138 @@ using System.Globalization;
/// Type and DbValue /// Type and DbValue
/// </summary> /// </summary>
namespace SharpReportCore { namespace SharpReportCore {
public class StandartFormatter : object {
public class StandardFormatter : object {
public StandartFormatter() { public StandardFormatter() {
} }
///<summary>Looks witch formatting Class to use, call the approbiate formatter public string FormatItem (string valueToFormat,string formatString,
/// and update the DbValue with the formatted String value TypeCode typeCode,string nullValue) {
/// </summary> string retValue = String.Empty;
///<param name="item">A ReportDataItem</param>
///
public string FormatItem (BaseDataItem item) {
if (item == null) { if (String.IsNullOrEmpty(formatString)) {
throw new ArgumentNullException("item"); retValue = valueToFormat;
return retValue;
} }
string retValue = String.Empty;
switch (item.DataType) { switch (typeCode) {
case TypeCode.Int16:
case "System.DateTime" : case TypeCode.Int32:
retValue = DateValues(item.DbValue,item.FormatString); retValue = IntegerValues (valueToFormat,formatString);
break; break;
case TypeCode.DateTime:
case "System.Int16": retValue = DateValues(valueToFormat,formatString);
retValue = IntegerValues ("16",item.DbValue,item.FormatString);
break; break;
case TypeCode.Boolean:
case "System.Int32" : retValue = BoolValue (valueToFormat,formatString);
retValue = IntegerValues ("32",item.DbValue,item.FormatString);
break; break;
case "System.Decimal": case TypeCode.Decimal:
retValue = DecimalValues (item.DbValue,item.FormatString); retValue = DecimalValues (valueToFormat,formatString);
break; break;
case "System.Boolean": case TypeCode.Double:
retValue = BoolValue (item.DbValue,item.FormatString); case TypeCode.Single:
break;
case TypeCode.String:
case TypeCode.Char:
retValue = valueToFormat;
break; break;
default: default:
retValue = item.DbValue; retValue = valueToFormat;
break; break;
} }
return retValue; return retValue;
} }
///<summary>Looks witch formatting Class to use, call the approbiate formatter
/// and update the DbValue with the formatted String value
/// </summary>
///<param name="item">A ReportDataItem</param>
///
public string FormatItem (BaseDataItem item) {
if (item == null) {
throw new ArgumentNullException("item");
}
return FormatItem(item.DbValue,item.FormatString,
Type.GetTypeCode( Type.GetType(item.DataType)),
item.NullValue);
}
public string BoolValue (string toFormat, string format){ private string BoolValue (string toFormat, string format){
string str = String.Empty; string str = String.Empty;
if (StandartFormatter.CheckFormat(format) == true) { try {
bool b = bool.Parse (toFormat);
if (StandartFormatter.CheckValue (toFormat)) { str = b.ToString (CultureInfo.CurrentCulture);
try { } catch (System.FormatException) {
bool b = bool.Parse (toFormat);
str = b.ToString (CultureInfo.CurrentCulture);
} catch (System.FormatException) {
// string s = String.Format("\tBool Value < {0} > {1}",toFormat,e.Message); // string s = String.Format("\tBool Value < {0} > {1}",toFormat,e.Message);
// System.Console.WriteLine("\t\t{0}",s); // System.Console.WriteLine("\t\t{0}",s);
}
}
} else {
str = toFormat;
} }
return str; return str;
} }
public string IntegerValues(string valueType,string toFormat, string format) { private string IntegerValues(string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (StandartFormatter.CheckFormat(format) == true) { if (StandardFormatter.CheckValue (toFormat)) {
if (StandartFormatter.CheckValue (toFormat)) { try {
try { int number = Int32.Parse (toFormat,
int number; System.Globalization.NumberStyles.Any,
switch (valueType) { CultureInfo.CurrentCulture.NumberFormat);
case "16":
number = Int16.Parse (toFormat, str = number.ToString (format,CultureInfo.CurrentCulture);
System.Globalization.NumberStyles.Any, } catch (System.FormatException) {
CultureInfo.CurrentCulture.NumberFormat);
break;
case "32" :
number = Int32.Parse (toFormat,
System.Globalization.NumberStyles.Any,
CultureInfo.CurrentCulture.NumberFormat);
break;
default:
throw new ArgumentException("DefaultFormater:IntegerValues Unknown intType ");
}
str = number.ToString (format,CultureInfo.CurrentCulture);
} catch (System.FormatException) {
// string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message); // string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message);
// System.Console.WriteLine("\t{0}",s); // System.Console.WriteLine("\t{0}",s);
}
return str;
} else {
str = (0.0M).ToString(CultureInfo.CurrentCulture);
} }
return str;
} else { } else {
str = toFormat; str = (0.0M).ToString(CultureInfo.CurrentCulture);
} }
return str; return str;
} }
public string DecimalValues(string toFormat, string format) { private string DecimalValues(string toFormat, string format) {
string str = String.Empty; string str = String.Empty;
if (StandartFormatter.CheckFormat(format) == true) { if (StandardFormatter.CheckValue (toFormat)) {
try {
if (StandartFormatter.CheckValue (toFormat)) { decimal dec = Decimal.Parse(toFormat,
try { System.Globalization.NumberStyles.Any,
decimal dec = Decimal.Parse(toFormat, CultureInfo.CurrentCulture.NumberFormat);
System.Globalization.NumberStyles.Any, str = dec.ToString (format,CultureInfo.CurrentCulture);
CultureInfo.CurrentCulture.NumberFormat);
str = dec.ToString (format,CultureInfo.CurrentCulture); } catch (System.FormatException) {
} catch (System.FormatException) {
// string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message); // string s = String.Format("\tDecimalValue < {0} > {1}",toFormat,e.Message);
// System.Console.WriteLine("\t{0}",s); // System.Console.WriteLine("\t{0}",s);
}
return str;
} else {
str = (0.0M).ToString(CultureInfo.CurrentCulture);
} }
return str;
} else { } else {
str = toFormat; str = (0.0M).ToString(CultureInfo.CurrentCulture);
} }
return str; return str;
} }
public string DateValues(string toFormat, string format) { private string DateValues(string toFormat, string format) {
try {
if (StandartFormatter.CheckFormat(format) == true) { DateTime date = DateTime.Parse (toFormat.Trim(),
try { CultureInfo.CurrentCulture.DateTimeFormat);
DateTime date = DateTime.Parse (toFormat.Trim(), string str = date.ToString(format,
CultureInfo.CurrentCulture.DateTimeFormat); DateTimeFormatInfo.CurrentInfo);
string str = date.ToString(format,
DateTimeFormatInfo.CurrentInfo); return str.Trim();
} catch (System.FormatException) {
return str.Trim();
} catch (System.FormatException) {
// string s = String.Format("< {0} > {1}",toFormat,e.Message); // string s = String.Format("< {0} > {1}",toFormat,e.Message);
// System.Console.WriteLine("\t\tDateValue {0}",s); // System.Console.WriteLine("\t\tDateValue {0}",s);
}
} else {
return toFormat.Trim();
} }
return toFormat.Trim(); return toFormat.Trim();
} }
private static bool CheckFormat (string format) {
if (String.IsNullOrEmpty(format)) {
return false;
}
return true;
}
private static bool CheckValue (string toFormat) { private static bool CheckValue (string toFormat) {
if (String.IsNullOrEmpty(toFormat)) { if (String.IsNullOrEmpty(toFormat)) {
return false; return false;

3
src/AddIns/Misc/SharpReport/SharpReportCore/SharpReportCore.csproj

@ -82,8 +82,6 @@
<Compile Include="Interfaces\IItemRenderer.cs" /> <Compile Include="Interfaces\IItemRenderer.cs" />
<Compile Include="Interfaces\IOutputStrategy.cs" /> <Compile Include="Interfaces\IOutputStrategy.cs" />
<Compile Include="Interfaces\IStoreable.cs" /> <Compile Include="Interfaces\IStoreable.cs" />
<Compile Include="Printing\Formatter\AbstractFormatter.cs" />
<Compile Include="Printing\Formatter\DefaultFormatter.cs" />
<Compile Include="Printing\Graphics\BaseLine.cs" /> <Compile Include="Printing\Graphics\BaseLine.cs" />
<Compile Include="Printing\Graphics\BaseShape.cs" /> <Compile Include="Printing\Graphics\BaseShape.cs" />
<Compile Include="Printing\Graphics\Border.cs" /> <Compile Include="Printing\Graphics\Border.cs" />
@ -133,6 +131,7 @@
<Compile Include="Exceptions\IllegalQueryException.cs" /> <Compile Include="Exceptions\IllegalQueryException.cs" />
<Compile Include="Events\SectionRenderEventArgs.cs" /> <Compile Include="Events\SectionRenderEventArgs.cs" />
<Compile Include="Printing\Text\StandartFormatter.cs" /> <Compile Include="Printing\Text\StandartFormatter.cs" />
<Compile Include="BaseClasses\DataTypeHelper.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="BaseItems" /> <Folder Include="BaseItems" />

Loading…
Cancel
Save