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

How to use fields in detail section in the page header

Status
Not open for further replies.

beacon5

Programmer
Dec 29, 2008
74
US
Hi everybody,

I want to use the first record in the detail section and the last record in the detail section for each page in the page header. I'm trying to create a dictionary of options that are available in a database application we use and want to place guidewords in the page header to help the user get to the option they are looking for quickly.

I have created a counter reset field and placed it in the header with the following code:
Code:
WhilePrintingRecords;
NumberVar Counter := 0;

I placed a counter for the details in the detail section:
Code:
WhilePrintingRecords;
NumberVar Counter;
Counter := Counter + 1;

This places a number next to each of the records for the field {table.OptionDescription} (string). Once the numbers are assigned to each record, I want to reference the first and last record and place the first 3 letters of the string in a field in the page header.

Ex:
If First record in detail section is Apple
and Last record in detail section is Awesome
then the guidewords in the page header would be
App - Awe

For the next page, the counter should reset and place the values in the header again.

I want to add these to this report because the report will be printed and distributed to users and there are too many pages to do it manually, especially as the options in the database change.

Is it possible to do this?

Thanks...
 
I don't believe you can get the results you are looking for in the page header. The last value on a page isn't known until the display occurs. Variables that use data as it is displays won't pass values up the page.

You can't evaluate the data before it is displayed because, again, Crystal doesn't know the last value or the count of the records on the page until it is displayed.

Would it be appropriate to display the App - Awe on the Page Footer?

If so, place the following formula in the header:

whileprintingrecords;

stringvar pgfirst;

pgfirst := left({field.name},3)

----

Place this formula in the page footer:

whileprintingrecords;

stringvar pgfirst;

pgfirst + " - " + left({field.name},3)

-----
 
So using something like EvaluateAfter for a formula in the page header wouldn't accomplish this?
 
Beacon,

I've used evaluateafter when using related variables in the same section and want to calculate one variable after another is finished.

I still don't believe it is possible to accomplish what you want but am interested in the views of others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top