Asp.net Crystal报告求和错误:“0”;(a)缺少“的”;
我的crystal reports公式中的以下行给出了错误:Asp.net Crystal报告求和错误:“0”;(a)缺少“的”;,asp.net,crystal-reports,runtime,Asp.net,Crystal Reports,Runtime,我的crystal reports公式中的以下行给出了错误: NumberVar sales0405 := Sum ({sp_YES_AccountSnapshot;1.ST0405_Ext}, {sp_YES_AccountSnapshot;1.Cust}) + Sum ({sp_YES_AccountSnapshot;1.DR0405_Ext}, {sp_YES_AccountSnapshot;1.Cust}); 错误: "The ) is missing" 该报告是使用Crystal
NumberVar sales0405 := Sum ({sp_YES_AccountSnapshot;1.ST0405_Ext}, {sp_YES_AccountSnapshot;1.Cust}) + Sum ({sp_YES_AccountSnapshot;1.DR0405_Ext}, {sp_YES_AccountSnapshot;1.Cust});
错误:
"The ) is missing"
该报告是使用Crystal reports 11创建的
当我在Crystal Reports中运行报告时,它运行良好
但是,当我使用Crystal Reports Basic for Visual Studio.NET 2008(2008年5月更新)(提供于)从ASP.NET web应用程序运行报告时,我会收到错误
我猜Crystal Reports较新版本的总结会有一些变化,但我一直找不到关于这个特定问题的任何文档
我已经验证了在我的测试用例中没有产生错误的空值
产生错误的行是公式的第一行
提前感谢您抽出时间
编辑:以下是整个公式
*numbervarsales0405:=Sum({sp_YES_AccountSnapshot;1.ST0405_Ext},{sp_YES_AccountSnapshot;1.Cust})+Sum
({sp_YES_AccountSnapshot;1.DR0405_Ext},
{sp_YES_AccountSnapshot;1.Cust});NumberVar sales0304:=总和
({sp_YES_AccountSnapshot;1.ST0304_Ext},
{sp_YES_AccountSnapshot;1.Cust})+Sum
({sp_YES_AccountSnapshot;1.DR0304_Ext},
{sp_YES_AccountSnapshot;1.Cust});如果sales0304=0,则
ToText(“销售额增加:不适用”)如果(sales0405{sp\u YES\u AccountSnapshot;1.Cust}
numbervarsales0405:=SUM({sp_YES_AccountSnapshot;1.ST0405_Ext})+SUM({sp_YES_AccountSnapshot;1.DR0405_Ext});
{sp\u YES\u AccountSnapshot;1.Cust}
numbervarsales0405:=SUM({sp_YES_AccountSnapshot;1.ST0405_Ext})+SUM({sp_YES_AccountSnapshot;1.DR0405_Ext});
您可能必须使用下面的覆盖部分选项(请参阅部分专家)来获得所需的布局。多个返回语句从来都不是一个好主意:
NumberVar sales0405 := Sum ({sp_YES_AccountSnapshot;1.ST0405_Ext}, {sp_YES_AccountSnapshot;1.Cust}) +
Sum ({sp_YES_AccountSnapshot;1.DR0405_Ext}, {sp_YES_AccountSnapshot;1.Cust});
NumberVar sales0304 := Sum ({sp_YES_AccountSnapshot;1.ST0304_Ext}, {sp_YES_AccountSnapshot;1.Cust}) +
Sum ({sp_YES_AccountSnapshot;1.DR0304_Ext}, {sp_YES_AccountSnapshot;1.Cust});
Stringvar output;
IF sales0304 = 0 THEN
output := ToText ("Increase in Sales: N/A")
ELSE IF(sales0405 < sales0304) THEN
output := ToText ("")
ELSE
output := "Increase in Sales: " + Replace (ToText (Int(RoundUp ((((sales0405 - sales0304) / sales0304) * 100)))), ".00", "") + "%";
numbervarsales0405:=Sum({sp_YES_AccountSnapshot;1.ST0405_Ext},{sp_YES_AccountSnapshot;1.Cust})+
Sum({sp_YES_AccountSnapshot;1.DR0405_Ext},{sp_YES_AccountSnapshot;1.Cust});
numbervarsales0304:=总和({sp_YES_AccountSnapshot;1.ST0304_Ext},{sp_YES_AccountSnapshot;1.Cust})+
Sum({sp_YES_AccountSnapshot;1.DR0304_Ext},{sp_YES_AccountSnapshot;1.Cust});
无功输出;
如果sales0304=0,则
输出:=ToText(“销售额增加:无”)
否则,如果(sales0405
产出
最后一行声明“output”变量是必需的,以便Crystal知道要打印什么。这也确保了数据类型始终相同。多个返回语句从来都不是一个好主意:
NumberVar sales0405 := Sum ({sp_YES_AccountSnapshot;1.ST0405_Ext}, {sp_YES_AccountSnapshot;1.Cust}) +
Sum ({sp_YES_AccountSnapshot;1.DR0405_Ext}, {sp_YES_AccountSnapshot;1.Cust});
NumberVar sales0304 := Sum ({sp_YES_AccountSnapshot;1.ST0304_Ext}, {sp_YES_AccountSnapshot;1.Cust}) +
Sum ({sp_YES_AccountSnapshot;1.DR0304_Ext}, {sp_YES_AccountSnapshot;1.Cust});
Stringvar output;
IF sales0304 = 0 THEN
output := ToText ("Increase in Sales: N/A")
ELSE IF(sales0405 < sales0304) THEN
output := ToText ("")
ELSE
output := "Increase in Sales: " + Replace (ToText (Int(RoundUp ((((sales0405 - sales0304) / sales0304) * 100)))), ".00", "") + "%";
numbervarsales0405:=Sum({sp_YES_AccountSnapshot;1.ST0405_Ext},{sp_YES_AccountSnapshot;1.Cust})+
Sum({sp_YES_AccountSnapshot;1.DR0405_Ext},{sp_YES_AccountSnapshot;1.Cust});
numbervarsales0304:=总和({sp_YES_AccountSnapshot;1.ST0304_Ext},{sp_YES_AccountSnapshot;1.Cust})+
Sum({sp_YES_AccountSnapshot;1.DR0304_Ext},{sp_YES_AccountSnapshot;1.Cust});
无功输出;
如果sales0304=0,则
输出:=ToText(“销售额增加:无”)
否则,如果(sales0405
产出
最后一行,声明“output”变量是必需的,以便Crystal知道要打印什么。这也确保了数据类型始终是相同的。刚刚遇到这个问题,这篇文章让我想到了一个问题,那就是函数
RoundUp()
这个函数在水晶报表席上介绍,你说你创建了你的报告。如果你使用一个老客户库(我写的一个软件是使用版本9),那么函数就不存在了,你所报告的错误发生了。
"The ) is missing"
我认为如果您创建一个自定义函数来替换RoundUp()
,可以随意调用,\u RoundUp()
,例如:
Function (NumberVar num, Optional NumberVar places := 0) (
-int(-num * (10 ^ places)) / (10 ^ places)
)
这是因为int()
通过对比例因子进行预乘法和后除法以反转比例,可以满足places
参数的要求。刚刚遇到这个问题,这篇文章将我引向了函数RoundUp()
的问题
这个函数在水晶报表席中被介绍,你说你在里面创建了你的报告。如果你使用一个老客户库(一个PI)