Page break depending on the number of records on subreport

Hi Experts,

How do I do something like this:

I have a report which utilizes the page header section.
Page header section contains, patient name and address (from table PATIENT).
The report breaks for each patient (a new page for each patient break).

I have created a subreport that also resides on the page header section also.
The subreport contains appointment schedules (from table SCHEDULE).
What I want is that for each page, only 10 records (from the subreport) will be displayed.
So if the subreport have 19 records, it will display the first 10 records
on the first page and the 9 remaining records will be displayed on the second page.
Say if I have 2 patients, if patient1 have 20 appointments and patient2 have 10 appointments,
there will be 2 pages that will be allocated for patient1 where page 1 contains the
schedule 1 to 10 and page 2 will contain schedule 11 to 20.
Page 3 will be use by patient2.

Can this be done?

I'm using Crystal 8.5 and MSSQL server 2000

Please Help,
yorge
yorgeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GJParkerCommented:
Yorge this can be done but it would get rather complicated and long winded to accomplish with the schedule data as a subreport.

Is it not possible for you to link the SCHEDULE table to the PATIENT table in the main report and retrieve the schedule details in the main report.

Or alternatively if this is not possible make the schedule information the main report and the patient data a subreport

If neither of these alternatives are possible post back and we'll look at working with the report as is.

Gary
0
mlmccCommented:
Try this in the subreport.

Open the subreport
CLick FORMAT --> FORMAT SECTION
Select the detail section
Select the NEW PAGE AFTER formula button
Formula
({RecordNumber MOD 10) = 0

mlmcc
0
GJParkerCommented:
mlmcc

That's only part of the problem, if you split the records in the subreport, first of all the formula would need to be

not (onfirstrecord) and (RecordNumber MOD 10) = 0

but this would not repeat the main report group header info on each page. that's why I feel it would be easier to change the schedule information to the main report if at all possible

Gary
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

mlmccCommented:
The first record should be 1 therefore my formula won't page break after it.  If he needs the group header information on each page, then there is a check box to repeat the header on each page in the GROUP Setup screen.

mlmcc
0
GJParkerCommented:
Modulus Divides x by y and returns a remainder that is a whole number therefore if RecordNumber = 1 then 1/10 = 0.1 MOD will return 1 and a page break will be inserted.

The Repeat Group header on each page option will not work in this case because it is the subreport which is causing the page break and not the main report.

Gary
0
yorgeAuthor Commented:
Hi mlmcc,

I've given your solution a try.
I got a  "The page size was not large enough to format the contents of an object in the report." error when I tried to preview the report.
Care to share what seems to be the problem here?

yorge
0
mlmccCommented:
GJParker - You are correct that 1 mod 10 = 1 but The formula then compares 1 = 0 which is false.  You only get true for 10, 20, 30, etc.

>>"The page size was not large enough to format the contents of an object in the report."
I have never seen that and I hav esome fairly large object in the report.  Is this preview in the designer?

mlmcc
0
yorgeAuthor Commented:
yes, this occurs after I've added the things you've mentioned above on the subreport and when I clicked on the preview tab, this error occured.

yorge
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
Glad i could help

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.