Crystal Reports - Sharing/passing cross tab results accross subreprpots

Posted on 2011-04-26
Last Modified: 2012-06-21
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?
Question by:czarubah

    Author Comment

    I cannot really link the tables as that duplicates the data.
    LVL 100

    Expert Comment

    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.


    Author Comment

    i am not sure I know how to pass an array, my array would have to be a two dimensional.
    LVL 100

    Accepted Solution

    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
    Shared NumberVar Array myTotals;

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

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    C# Crystal Reports 15 57
    Formatting a Crystal Reports Report 9 43
    Select Cross-tab total 2 33
    Grand Totals on Crystal Reports 7 31
    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now