Compiling problems at conditions in version 2009.3.509.0 - is changing the expression
Posted: Mon Oct 12, 2009 10:39 am
At the field Text12 there is a Condition with expression defined like this:
((double)Sum(ProjectActivities.Duration) - GetWorkTime(new DateTime(ProjectActivities.StartTime.Year, ProjectActivities.StartTime.Month, 1),new DateTime(ProjectActivities.StartTime.Year, ProjectActivities.StartTime.Month, 1).AddMonths(1).Subtract(new TimeSpan(1,0,0,0)))) < 0
Or you could also write:
((double)Sum(ProjectActivities.Duration) - 1) < 0
If the Report is compiled the SourceCode is definitely changed and looks like this and is causing errors:
private void Text12_Conditions(object sender, System.EventArgs e)
{
if (((double)Totals.Sum(ProjectActivities.Duration) this, "GetTotal1") < 0)
{
((Stimulsoft.Report.Components.IStiTextBrush)(sender)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
((Stimulsoft.Report.Components.IStiBrush)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Gainsboro);
((Stimulsoft.Report.Components.IStiFont)(sender)).Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = true;
return;
}
}
It seems there is a problem, if a minus “-“ or brackets “)” are present in the condition.
The same report worked fine in Version 2008.1.222.0.
Please help me in this case, because a lot of conditions are used in the reports.
Best regards
((double)Sum(ProjectActivities.Duration) - GetWorkTime(new DateTime(ProjectActivities.StartTime.Year, ProjectActivities.StartTime.Month, 1),new DateTime(ProjectActivities.StartTime.Year, ProjectActivities.StartTime.Month, 1).AddMonths(1).Subtract(new TimeSpan(1,0,0,0)))) < 0
Or you could also write:
((double)Sum(ProjectActivities.Duration) - 1) < 0
If the Report is compiled the SourceCode is definitely changed and looks like this and is causing errors:
private void Text12_Conditions(object sender, System.EventArgs e)
{
if (((double)Totals.Sum(ProjectActivities.Duration) this, "GetTotal1") < 0)
{
((Stimulsoft.Report.Components.IStiTextBrush)(sender)).TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Red);
((Stimulsoft.Report.Components.IStiBrush)(sender)).Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Gainsboro);
((Stimulsoft.Report.Components.IStiFont)(sender)).Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
((Stimulsoft.Report.Components.StiComponent)(sender)).Enabled = true;
return;
}
}
It seems there is a problem, if a minus “-“ or brackets “)” are present in the condition.
The same report worked fine in Version 2008.1.222.0.
Please help me in this case, because a lot of conditions are used in the reports.
Best regards