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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table of contents in subreport

Status
Not open for further replies.

mjm2001

IS-IT--Management
May 22, 2001
4
US
i've been reading through the posts and couldnt find a definite answer so i will ask again.

i am trying to create a table of contents using a subreport in a header of my main report. in doing that i am having problems linking the information together. i want to pull from the main report the fullname, the corresponding page number and a few other fields, which that person appears on. everytime i run the reports it asks for parameters but i dont have any. all i want are the names and whatever page they are on, sounds simple enough.

there probably isnt an answer to this table of contents thing but i didnt think it would be so difficult. thanks for any responses.
 
There is no way to capture the page number in a subreport, because the subreport is paginated by the main report.

The prompt you are getting is Possibly because you tried to link the subreport to the main report using a page number? Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Hello

You might be able to achieve this by using the store and fetch ufl. You can download this from the crystal decisions site. Here is an article clipping that might help guide you also. Below I have also included links for the store and fetch ufl and an article on using it.

************************
In the main report place the following formula in the Group Header:

@Store

WhilePrintingRecords;
if Not InRepeatedGroupHeader
then
StoreNumberVar ({Customer.Customer Name},PageNumber);

{Customer.Customer Name} is the field that the main report is grouped
on.

Next create an unlinked subreport in the report footer of the main report. The subreport needs to report off of the same Tables that were used to create the group in the main report.

Place the database field, that the main report was grouped on, in the detail section of the subreport. Beside this field, place the following formula:

@Fetch

WhilePrintingRecords;
FetchNumberVar ({Customer.Customer Name})

This formula will retrieve the page number that is stored with each Group Header

Note:

For each Fetch variable there needs to be a corresponding Store variable.
******************

Using the store and fetch

******************
Store and fetch ufl download
********************

Hope this helps. E. McEvoy
Crystal Reports Consultant
emcevoy@crystalconsulting.ca
 
Note that Store and Fetch are a patch for shared variables that are used with V5 and V6. Subsequent versions of Crystal Reports allow greater flexibility with shared variables.
Also note that this will not meet your stated goal of a table of contents at the beginning of the report - Cystal doesn't "know" what it prints on page 3 until it has finished printing pages 1 and 2. Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top