Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport Assistance - Need Data in Group Header

Status
Not open for further replies.

msanders67

Technical User
Sep 3, 2002
16
US
Okay, I've successfully shared variables; however, I can only seem to get the fields populated when I put the formulas to display the shared variables in a footer on the report. I need the fields from the subreport displayed in a group header as well as use them to caluclate a percentage that is also in the group header.

I should mention that I've tried putting my subreport in report header A and still no dice! Am I missing something elementary?

TIA,
Margo
 
The formula in the main report, using a shared variable value set in a subreport, must be in a section following the section where the subreport is placed.

You can place the subreport in GH1a and use the value in GH1b

hth,
- Ido CUT & Visual CUT: e-mailing, exporting, bursting, distribution, and scheduling of Crystal Reports:
 
I still cannot get the shared data to populate the fields in the main report. I have positioned the subreport in RHa and the formulas to display the shared variables are in RHb.

Anyone? Any ideas of what I could be missing?

TA!
Margo
 
Why are you putting them in RH sections when you wanted them in GH sections?

Post the formulas themselves and where each is located. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken: I've since changed the format of the report and now require the formulas to be printed in RHb.

Ido: I will eventually need to share other variables to use for calculations, and will also be using these fields to get data from an array. However, for now, I am just trying to get them to print on the main report.

Here are the shared formulas from the main report:
//fiscal_pd
shared stringvar fiscal_pd :=""

//fiscal_year
shared stringvar fiscal_year :=""

Now in the subreport:
//fiscal_pd
shared stringvar fiscal_pd:={GL0_Parameters.CurrentAccountingPeriod}

//fiscal_year
shared stringvar fiscal_year :={GL0_Parameters.CurrentCalendarYr}

And finally, to display the fields in the main report:
//display_fiscal_pd
shared stringvar fiscal_pd;
fiscal_pd

//display_fiscal_year
shared stringvar fiscal_year;
fiscal_year

Thanks for you help!

Margo
 
The first 2 formulas aren't necessary unless you need to reset the variable for each group.

The last two formulas don't need the 3rd line.

What section is each formula in? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken:

The first two formulas aren't on the report. The second two are on the subreport in the detail section. The last two forumlas are on the main report in RHb. The subreport itself is in RHa.

I understand about resetting the values, which I will eventually need to do.

Thanks for you help,
Margo
 
If the first two formulas aren't on the report you should delete them completely.

Why are the subreport fomrulas in the detail section? These variables will only pass one value each, and that will be from the last record of the subreport. How many records are being retured by the subreport. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Ken:

You are the man! I moved the subreport formulas to the report header and the data is now being pulled into the main report.

You are my hero!

Thank you so much (and Ido as well) for all of your help!
Margo
 
Potential Explanation:

Seems to me like your subreport was not returning any records, hence the detail section was never evaluated.

By moving the formulas to the report header you forced
them to be evaluated.

Cheers,
- Ido CUT & Visual CUT: e-mailing, exporting, bursting, distribution, and scheduling of Crystal Reports:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top