Skip to Content
author's profile photo Former Member
Former Member

Please Help! Formula Evaluating AFTER Sub Report!

Post Author: jmb1977

CA Forum: Formula

Hello all! Please Help!!

Here is what I have:

Main Report has wo formulas...

@CT1

whileprintingrecords;Shared StringVar CT1;CT1;

and @CT2

whileprintingrecords;Shared StringVar CT2;CT2;

Nothing in the Selection Expert.

Then I have two Sub Reports for reading in phone numbers.

Sub Report Name is Contact 1

I have one forumla:

whileprintingrecords;Shared stringVar CT1 := {STUDCTCT.CNTWPHONE};

and Sub Report 2 is called Contact 2 with this formula:

whileprintingrecords;Shared stringVar CT2 := {STUDCTCT.CNTWPHONE};

In each sub report I have the following in the Selection Expert:

{STUDCTCT.CNTNUMBER} in ["C1"] and{STUDDEMO.STDNUMBER} = {?Pm-STUDDEMO.STDNUMBER}

But for the Contact 2 sub report, I substitute C1 for C2.

In the details section of my sub reports I throw the variable on there for the formula.

Here is the problem:

When I run the report, the sub reports show the data fine with the correct student records. However, when I place the variable in my Group section of the report, it shows the phone numbers for the record above it. Somehow, the variables are executing BEFORE the Sub Report. Is there anyway to fix this so the sub report executes BEFORE the two formulas so I get the right data associated with the right student?

I am new to crystal reports and I hope I explained this well enough, if not, I will try to explain better.

Please Help!

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 03:54 PM

    Post Author: jmb1977

    CA Forum: Formula

    also I need to read them in as variables so I can export the data. That is why I am trying to display variables in the main report. But like I said, the issues is that the variables are calculating BEFORE the sub reports, so I am always one record off.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 05:24 PM

    Post Author: yangster

    CA Forum: Formula

    were is the subreport located on the main report and where are the shared variables being displayed on the main report?my guess would be you have the subreport in the report footer or group footer, move the subreport to the report header or group header so it is evaluated right away

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2007 at 06:31 PM

    Post Author: jmb1977

    CA Forum: Formula

    The variables/formulas are in the Group Header. I have tried moving the sub reports to the page header and report header, when I do that, the variables display nothing. With the sub reports in the Group and Details sections, it displays the data fine, except the variables are a record off.

    Another problem that I see also is, when you do an export to created a CSV file, the export ignores the variables.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.