2012-02-29 3 views
0

FastReport.Net에서 마이너스 값을 바닥 글에 넣고 싶습니다. 내 코드 :FastReport.net의 마이너스 2 값

private void PageFooter1_BeforeLayout(object sender, EventArgs e) 
    { 
     Text22.Text=Convert.ToString(Convert.ToDouble(Text12.Text)-Convert.ToDouble(Text3.Text)); 
    } 

이 오류가 있었다 발생

FastReport.Net v1.7.33 
Exception has been thrown by the target of an invocation. 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format. 
    at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) 
    at FastReport.ReportScript.PageFooter1_BeforeLayout(Object sender, EventArgs e) 
    --- End of inner exception stack trace --- 
    at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at FastReport.Code.ExpressionDescriptor.Invoke(Object[] parameters) 
    at FastReport.BandBase.CalcHeight() 
    at FastReport.Engine.ReportEngine.ShowBandToPreparedPages(BandBase band, Boolean getData) 
    at FastReport.Engine.ReportEngine.ShowBand(BandBase band, Boolean getData) 
    at FastReport.Engine.ReportEngine.EndLastPage() 
    at FastReport.Engine.ReportEngine.RunReportPage(ReportPage page) 
    at FastReport.Engine.ReportEngine.RunReportPages() 
    at FastReport.Engine.ReportEngine.RunReportPages(ReportPage page) 
    at FastReport.Engine.ReportEngine.Run(Boolean runDialogs, Boolean append, ReportPage page) 
    at FastReport.Report.Prepare(Boolean append) 
    at FastReport.Design.ReportTab.Preview() 

이 사람이 나를 도울 수 있습니까?

답변

1

DataTextFormatString="{0:Axx}"을 시도하고 코드를 BeforePrint 이벤트에 넣을 수 있습니다. 예를 들어

:

private void Text14_BeforePrint(object sender, EventArgs e) 
{ 
    Text14.Text=string.Format("{0:N}",((Decimal)Report.GetColumnValue("Table.money"))-((Decimal)Report.GetColumnValue("Table.TRSMONEY"))); 
}