我有一份报告显示不同项目的不同费率。其中一项是“里程”,其费率包含小数美分 ( 0.565
)。
我们希望显示0.565
这些费率的全部内容,并以小数点后两位显示所有其他费率。
为了促进这一点,我Format Field > Number > Customize
对两者都使用了一个公式Decimals
,Rounding
看起来基本上是这样的:
if({RATE_TYPE}='MILEAGE')then 3 else 2
这似乎在 Crystal Reports 中正常工作。里程显示小数点后3位,四舍五入到小数点后3位。
在 Crystal Reports Viewer(和后续导出)中,它显示 3 个小数位,但它舍入到 2 个小数位。
我正在使用 Crystal Reports 2008 (12.3.0.601) 和 Crystal Reports Viewer:
<system.web>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
</sectionGroup>
</sectionGroup>
...
<compilation debug="true" defaultLanguage="c#">
<assemblies>
...
<add assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Enterprise.InfoStore, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportSource, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Shared, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add assembly="CrystalDecisions.Enterprise.Framework, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
...
</assemblies>
<buildProviders>
<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</buildProviders>
</compilation>
...
<httpHandlers>
...
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
...
</httpHandlers>
...
</system.web>
<system.webServer>
...
<handlers>
...
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
...
</handlers>
...
</system.webServer>
(对不起代码墙)
有没有人遇到过这个?有已知的修复方法吗?