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?
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
0
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
0
Michael KatzAuthor Commented:
The main report could be several pages..I am hoping to get records in gh3 that are from the shared variable
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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
0
Michael KatzAuthor Commented:
It Is working...I am trying to suppress this section when it is blank...Not working.. any ideas
0
mlmccCommented:
What section are you trying to suppress?

What is in that section?

mlmcc
0
Michael KatzAuthor Commented:
GH#3b… a field is there based on the result from above
0
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
0

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.

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.