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!

Wrong header is displayed when certain condition is met

Status
Not open for further replies.

sent10g

Programmer
Oct 21, 2003
2
US
Hi,

My application produces a text file. Then Crystal Report ActiveX control(v.8.0) displays a report based on that file using template.

The file is in the following format:

H01:First Bank
H02:Center1
H03:-------------------------------------
H04: Average Bal Budget
H05: 07/2003 01/2004
H06: ----------- -------
D :Assets
D :------
D :Teller cash 626,564 636,568
D :Other AFS 123,456 777,777
D :
.
.
.
D :Total 7,987,777 89,787,721

H01:First Bank
H02:Center2
H03:-------------------------------------
H04: Average Bal Budget
H05: 07/2003 01/2004
H06: ----------- -------
D :Assets
D :------
D :Teller cash 785,721 465,098
D :Other AFS 582,098 680,852
D :
.
.
.
D :Total 987,781 9,787,891

H01:First Bank
H02:Center3
H03:-------------------------------------
H04: Average Bal Budget
H05: 07/2003 01/2004
H06: ----------- -------
D :Assets
D :------
D :Teller cash 634,868 123,568
D :Other AFS 934,855 987,783
D :
.
.
.
D :Total 7,096 787,721

...and so on.

Everything works okay with only one exception. If the last detail line ("Total" in my example) for a certain center is happened to be the last line on a page then Crystal picks up the wrong header. For instance, if "Total" for center2 is the last line on a page the next page will still display header for Center2 rather than for Center3. The template uses formula to calculate headers "WhilePrintingRecords" but it seems like Crystal inserts a new page once it reaches the end of the current one BEFORE it processes the next record in the file and I do not know how to make Crystal(if it is possible at all) NOT to do that. It seems like I do not have a control over that.

Any input will be greatly appreciated.

Sergey

P.S. The actual text file and the template can be provided if needed.
 
In Crystal 8.5, you could make 'Centre' a group, and use group headers in place of page headers. Is this any use?

Alternatively, dependant on what you are doing, you could change the test to use record data rather than a shared variable, which is how you seem to be doing it. A header picks up record data from the first detail line on that page.

Madawc Williams
East Anglia, Great Britain
 
Hi Madawc,

Thanks for the reply, I really appreciate that.
I am going to try your suggestion to use record data rather than a variable.
Thanks again,

Sergey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top