我想检索当前行中的上一行值,如下所示(Crystal Report 2008): +------------+-----------------+----------+------------+----------------+| Date | PreviousBalance | Loan | Collection | CurrentBalance |+============+=============
+------------+-----------------+----------+------------+----------------+ | Date | PreviousBalance | Loan | Collection | CurrentBalance | +============+=================+==========+============+================| | 14/02/2012 | 00.00 | 10000.00 | 00.00 | 10,000.00 | | 15/02/2012 | 10,000.00 | 00.00 | 500.00 | 9,500.00 | | 16/02/2012 | 9,500.00 | 00.00 | 500.00 | 9,000.00 | | 18/02/2012 | 9,000.00 | 5,000.00 | 00.00 | 14,000.00 | +------------+-----------------+----------+------------+----------------+这比看起来容易:
>为字段{table.Loan}创建两个Running Totals,一个用于Loan {#TLoan},为字段{table.Collection}创建一个Collection {#TCol}.
>创建一个公式:{@Total},其中包含以下内容:
{#TLoan} – {#} TCOL
这将具有CurrentBalance值.
>创建另一个公式:{@Prev},其中包含以下内容:
{@Total} – {table.Loan} {table.Collection}
这将具有PreviousBalance值.
使用这种方法不需要复杂的公式,结果是预期的.
希望能帮助到你!