• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 636
  • Last Modified:

Crystal Reports - Sharing/passing cross tab results accross subreprpots

I have a crystal report that has a couple of subreports. both subreports use a cross tab to create a set.

In one report, i calculate guest counts by server on the other I calculate items sold group by specific rules. now I need to calculate the ratio of Grouped Items divided by the guest count.

the data is in two different tables (flat dbf files). so the question is can I pass the array (result of the cross tab) from one subreport to the other (or to the main report) so I can do calculations?
0
czarubah
Asked:
czarubah
  • 2
  • 2
1 Solution
 
czarubahAuthor Commented:
I cannot really link the tables as that duplicates the data.
0
 
mlmccCommented:
No.  A cross tab is just a display method.  The data is not available for sharing.

You could create an array in the first subreport and share it with the second one.  You would have to do the calculations too build the array yourself.

mlmcc
0
 
czarubahAuthor Commented:
i am not sure I know how to pass an array, my array would have to be a two dimensional.
0
 
mlmccCommented:
Crystal doesn't have 2 dimensional arrays so that part won't work.

You don't really pass between.
You use shared variables.

Basic concept

Main Report
Declare the variables
WhilePrintingRecords;
Shared NumberVar Array myTotals;
""

In the subreport
WhilePrintingRecords;
Shared NumberVar Array myTotals;
ReDim myTotals[5];
myTotals[1] := 7;
""

In the other subreport
WhilePrintingRecords;
Shared NumberVar Array myTotals;
myTotals[1] + myTotals[2]

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now