Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top