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

Repagination for each new record

Status
Not open for further replies.

MsPepperMintUSA

Programmer
Mar 15, 2001
52
US
Crystal Report 7.0
Back-end: Sybase
Front-End: Crystal Report

I have create a report which has 4 subreports. I suppress any empty subreport during the printing process.

The report has approximately 196 records(and will continue to grow). The report has approximately 240 pages. This will change as the subreports can grow, if additional information is supplied.

I am trying to re-number the pages for each new record dynamically.

Is this possible in the Crystal Report environment?
 
faq149-182 shows you several ways to do what is in essence a "running total". You can use either a CR running total, with the value reset on change of record. Or you can use the three formula technique. Both are described in the FAQ. Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
I have tried implementing that FAQ. I attempted to reset the count when the RecordNumber changes.The problem is assigning the initial values to all the variables and writing the nested if statement. The layout of my report does not include any groups - it is not necessary. The layout has a page header, detail sections, and a page footer. The embedded subreports are similar to dynamic views of related data linked by a nested foreign key.

Crystal Report Background: The last version I used was Version 6. I displayed data using VB 5 as front and SQL as backend in 1998. Perhaps the functionality I needed is built-in and I am making this more difficult than it should be. My most current experience is developing web pages and applications since 1999.

I am not clear how to use this scripting language to determine how many pages are assigned to each record. When developing web pages, this number is stored in built-in variable in ASP - those links that store the recordset absolutepage and determine how many pages per record are needed for that unique record.

Is the similar functionality stored in a built-in variable in the Crystal Report environment? If not, is it possible to calculate the variable using code?

My goal is to create one formula that does it all. The printed report must the correct pagination for each record in the report. The formula must generate the correct page number on screen, while the end-user traverse through the report. For instance if the enduser is viewing record 4, then decided to go back to record 1, the formula show generate the correct page number.

Below is a sample of my code:

WhilePrintingRecords;
NumberVar intPageCount;
NumberVar curRecord;


If RecordNumber = curRecord then
if PageNumber > 0 then
intPageCount:= intPageCount + 1;
else
intPageCount:= 1;
Else
intPageCount:= 1;
curRecord:= RecordNumber;
 
Just in case someone wants to know how this issue was resolved, please see FAQ: faq767-923.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top