Crystal将交叉表列的总计报表作为变量 [英] Crystal Reports Cross-Tab Column Totals as Variables

查看:78
本文介绍了Crystal将交叉表列的总计报表作为变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Crystal 2008中有一个报表,该报表包含2个子报表,每个子报表都是一个Crosstab。我将它们分为不同的报告,因为它们的选择与数据库查询无关。



我需要能够为每个列总计创建一个变量并能够将其传递到两个交叉表中的每个交叉表的第三个报告中。



每个交叉表的布局格式相同,其中列为PO数字和针对每个PO收费的行。这是我需要进行进一步计算的列的总数。



Crosstab1的总计Column1-Crosstab2的总计(按选择显示的每个列)



我尝试使用CurrentFieldValue,但这似乎只是将最后一条记录的总数设置为变量。 / p>

我希望有办法做到这一点,并且我已经为您提供了足够的信息以帮助我。

解决方案

我认为很难从交叉表中获取价值,但一种解决方法是。


  1. 在两个子报表中都创建一个共享变量,并将摘要值分配给该共享变量。

假设交叉表显示的是员工薪水总和,然后在公式中将值分配给共享变量

  Shared Numbervar report1; 
report1:=总和(employee.salary)





  1. 现在在主报表中创建一个公式



    共享NumberVar报告1;
    Shared NumberVar报告2;
    report1 + report2;


让我知道这是怎么回事。 / p>

I have a report within Crystal 2008 that has 2 subreports, each of which is a Crosstab. I have split them into different reports as their selection and database queries are unrelated.

What i need to be able to to is to create a variable for each of the Column Totals and be able to pass this onto a third report for each of the two cross Tabs.

The Layout of each cross tab is formatted the same, with the columns being the PO Number and the rows being charges against each PO. It is the total of the columns that I need to perform a further calculation on.

Total of Crosstab1 Column1 - Total of Crosstab2 Column1 for each column that is displayed by the selection query to give me a difference between the two crosstabs.

I have tried using the CurrentFieldValue but this only appears to set the total of the very last record to the variable.

I hope that there is a way to do this and that i have provided enough information for you to be able to assist me.

解决方案

I think its hard to get the value from crosstab but one workaround would be.

  1. Create a shared variable in both subreports and assign the summary value to the shared variable.

Suppose cross tab is showing employee salary sum then in the formula assign the value to the shared variable as

Shared Numbervar report1;
report1:=Sum(employee.salary)

  1. similarly do in the second subreport aswell.
  2. Now in main report create a formula

    Shared NumberVar report1; Shared NumberVar report2; report1+report2;

let me know how it goes.

这篇关于Crystal将交叉表列的总计报表作为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆