问题描述:
Me.txtAmount.Border.BottomColor = System.Drawing.Color.Black
Me.txtAmount.Border.BottomStyle = GrapeCity.ActiveReports.BorderLineStyle.None
Me.txtAmount.Border.LeftColor = System.Drawing.Color.Black
Me.txtAmount.Border.LeftStyle = GrapeCity.ActiveReports.BorderLineStyle.None
Me.txtAmount.Border.RightColor = System.Drawing.Color.Black
Me.txtAmount.Border.RightStyle = GrapeCity.ActiveReports.BorderLineStyle.None
Me.txtAmount.Border.TopColor = System.Drawing.Color.Black
Me.txtAmount.Border.TopStyle = GrapeCity.ActiveReports.BorderLineStyle.None
Me.txtAmount.CanShrink = True
Me.txtAmount.DataField = "AMOUNT" ' 假设该绑定字段的值是 10.00 *****************
Me.txtAmount.Height = 0.1875!
Me.txtAmount.Left = 8.3125!
Me.txtAmount.Name = "txtSubAmount2"
Me.txtAmount.OutputFormat = "$#,##0.00" ' 指定了输出格式 *********************
Me.txtAmount.Style = "text-align: right; font-size: 8.5pt; font-family: 'Arial'; "
Me.txtAmount.Text = Nothing
Me.txtAmount.Top = 0.0625!
Me.txtAmount.Width = 0.9375!
Private mdblSubTotal As Decimal = 20.00
txtAmount.Text = Format(mdblSubTotal, "currency")
txtAmount 的值导出PDF后正常显示为预期的 $20.00, 但是导出excel后显示为绑定的 AMOUN字段的值 ¥10.00
txtAmount.Text = Format(mdblSubTotal, "currency") 在V17中失去作用(针对 excel)
该问题目前通过把 txtAmount.Text = Format(mdblSubTotal, "currency") 改成 txtAmount.Value=mdblSubTotal 解决了。
但是目前我们遗留代码太多,希望升级后不要改变原有代码的行为,麻烦看看有其它不用改代码可以修复的方法没,多谢。
注:txtAmount.Text = Format(mdblSubTotal, "currency") 在 V5 版本中工作正常。
|