Crystal reports Crystal报告公式变量传递

Crystal reports Crystal报告公式变量传递,crystal-reports,formula,Crystal Reports,Formula,我正在编写此报告,它将我们所有的预计采购按月份分组,显示当月的金额(称为“月度总额”),以及当月的预算(称为“月度预算”)。我还有一个子报告,使用共享的currencyvar“起始余额”。每当运行报告时,此共享变量都会更新。 我需要找到一种方法来进行以下计算: 第一个月(在本例中,报告从3月开始)应为 "Starting_Balance" + "Monthly_Total") - "Monthly_Budget" = "New_Balance" 随后的每个月都将使用该公式 ("New_Bala

我正在编写此报告,它将我们所有的预计采购按月份分组,显示当月的金额(称为“月度总额”),以及当月的预算(称为“月度预算”)。我还有一个子报告,使用共享的currencyvar
“起始余额”
。每当运行报告时,此共享变量都会更新。 我需要找到一种方法来进行以下计算:

第一个月(在本例中,报告从3月开始)应为

"Starting_Balance" + "Monthly_Total") - "Monthly_Budget" = "New_Balance"
随后的每个月都将使用该公式

("New_Balance" + "Monthly_Total") - "Monthly_Budget"
我可以让它为第一组页脚工作,但之后的每个月都会引用
“起始余额”
,而不是
“新余额”


有什么想法吗?

尝试使用一个标志变量,表示是否已报告第一个月。我最初认为使用新的\u余额为0,但这可能会自然而然地发生

比如

报告标题中的初始值设定项:

WhilePrintingRecords;
Global BooleanVar First_Month_Done := false; // have we printed the first month?
""; // print nothing on screen
月公式

WhilePrintingRecords;  // Optional when using shared variables
Global BooleanVar First_Month_Done;
Global CurrencyVar New_Balance;  //or whatever it is
Shared CurrencyVar Starting_Balance;
// Assuming "Monthly_Total" and "Monthly_Budget" are formulas, not variables

If First_Month_Done
    Then New_Balance := New_Balance + {@Monthly_Total} - {@Monthly_Budget}
    Else New_Balance := Starting_Balance + {@Monthly_Total} - {@Monthly_Budget};

First_Month_Done := true;
New_Balance

尝试使用一个flag变量来表示是否已经报告了第一个月。我最初认为使用New_Balance作为0,但这可能会自然而然地发生

比如

报告标题中的初始值设定项:

WhilePrintingRecords;
Global BooleanVar First_Month_Done := false; // have we printed the first month?
""; // print nothing on screen
月公式

WhilePrintingRecords;  // Optional when using shared variables
Global BooleanVar First_Month_Done;
Global CurrencyVar New_Balance;  //or whatever it is
Shared CurrencyVar Starting_Balance;
// Assuming "Monthly_Total" and "Monthly_Budget" are formulas, not variables

If First_Month_Done
    Then New_Balance := New_Balance + {@Monthly_Total} - {@Monthly_Budget}
    Else New_Balance := Starting_Balance + {@Monthly_Total} - {@Monthly_Budget};

First_Month_Done := true;
New_Balance

这正是我想要的。谢谢你结束了我两周的头痛!这正是我想要的。谢谢你结束了我两周的头痛!