Shared Variable only showing for last record of GH#3.. not for all records in GH#3

Hello,

Sure this is pretty easy.. but never can get this right..

In the PH of the Main report i have a sub report with the following formula

@initialize

WhilePrintingRecords;
Shared Stringvar SalesOrder:= totext(val({SorDetail.SalesOrder}),'000000');
Shared Stringvar Component:={SorDetail.MPrintComponent};
Shared Stringvar KitType:={SorDetail.MParentKitType};
Shared Stringvar StockCode:={SorDetail.MStockCode};
Shared Stringvar MWarehouse:={SorDetail.MWarehouse};

The Main report has the following formula in the GH#3  @Kit

Shared Stringvar SalesOrder;
Shared Stringvar Component;
Shared Stringvar KitType;
Shared Stringvar StockCode;
Shared Stringvar MWarehouse;

if {Documents/Document/HeaderData.InternalSalesOrder} = SalesOrder
and
{@Stock code} = StockCode
then KitType else ''

the problem is only the last record of the GH#3 is showing the KitType…How can I get all records in GH#3 to show the KitType..

Also the sub report is rather long and showing values  in the Main Report.. How can i not show this information in the PH
Michael KatzAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Is this a single page report?
If not then the subreport is running for each page.  Is that what you want?

mlmcc
mlmccCommented:
To avoid showing the subreport you could put it in a second pageheader and hide the section.

Another way is to make sure the subreport doesn't display anything then suppress a blank subreport in the subreport format.

mlmcc
Michael KatzAuthor Commented:
The main report could be several pages..I am hoping to get records in gh3 that are from the shared variable
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

mlmccCommented:
Does the subreport need to run once or does it need to run for each group?

If only once put it in the report header.
If for each group put it in the group header

mlmcc
Michael KatzAuthor Commented:
It Is working...I am trying to suppress this section when it is blank...Not working.. any ideas
mlmccCommented:
What section are you trying to suppress?

What is in that section?

mlmcc
Michael KatzAuthor Commented:
GH#3b… a field is there based on the result from above
mlmccCommented:
What field is there?

I just reread your question.
A group header only has 1 record available to it.  Why are you expecting more than 1 value?

mlmcc

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.