Asp.net Crystal报告求和错误:“0”;(a)缺少“的”;

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

我的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 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 事实证明,是最后一行造成了问题。知道为什么吗?我通过删除Replace、Int和Roundup函数(在这个过程中去掉了几个括号)修复了它

注意:很抱歉,该代码的格式不好,我无法使用crystal的多行复制粘贴将代码标记放置在nice中。

我会:

  • 在详细信息部分为
    {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)