Avatar of Pioneermfg
PioneermfgFlag for United States of America

asked on 

report format

I have a report that contains 2 sub reports and multiple groupings.  the sub reports can grow based on the data returned.  as long as the returned data is 10 lines or less everything is fine.  things go sideways when the subreport grows beyond 10 lines.  How can I make crystal reports force a new page if the sub report grows beyond 10 lines.
Crystal Reports

Avatar of undefined
Last Comment
Pioneermfg
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Please can you say more clearly what problem occurs if there more than 10 lines.  I don't see that we can guess what problem you are having.

Avatar of Mike McCracken
Mike McCracken

WHat section is the subreport in?

In general, the records beyond 1 should go to a new page automatically.

mlmcc
Avatar of frodoman
frodoman
Flag of United States of America image

>>> How can I make crystal reports force a new page if the sub report grows beyond 10 lines.

Assuming that "line" is a record in your data, you can add a formula to your details Section Expert that will increment a shared variable by 1 and return TRUE if the result is a multiple of 10.  This will force a page break every 10 records.

I can help w/ more details if this is what you want, but as Pete said your question is somewhat vague.

frodoman
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

here is the layout
rh suppress
ph suppress
grp h1 visible approx size is 3 and 7/8 inches long
details contains subreport
grp f1 visible and is approx 1 inch long
grp f1b visible and approx size is 3 and 7/8 inches long
grp f1c contains identical subreport as in the details section

okay so let me try to explain:  this will be our purchase order.  it is printing on legal size paper (8.5X14).  there is a perforation at the 7 inch mark.  the top half is for the office the bottom half is for the warehouse.  if the details section has more than 5 lines (tried recordnumber = 5) to move everything after the details section to a new page (f1, f1b, f1c, etc...).  on the right track, but what i am getting is not what i expected.  

so I am asking is there a way to tell crystal that if the "details:" section is greater than say 2 inches in length to move every section beneath that to another page?  Do I need to use the "while printing records" with "recordnumber"?
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

In my opinion, if you are printing the details in a subreport there is no reliable solution available to you.

You could use a second details section in the subreport which you sized large enough to force a new page, and print it (don't suppress it) every 5 records in the subreport.  
When you say 5 lines, is that 1 line per record?

mlmcc
Avatar of frodoman
frodoman
Flag of United States of America image

>>> is there a way to tell crystal that if the "details:" section is greater than say 2 inches in length to move every section beneath that to another page

No, there isn't.  You can create a variable and use it to count record intervals and do page breaks based on the intervals but you can't do anything based on the size of the records on your page.
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

frodoman can you give me an example of what that would look like?
Avatar of frodoman
frodoman
Flag of United States of America image

>>> frodoman can you give me an example of what that would look like?

Report -> Section Expert.  Select your Details section and click the formula (X+2) button to the right of "New Page Before".  Enter the formula below:

shared numberVar rowcounter;
rowcounter := rowcounter + 1;
if rowcounter mod 5 = 0 then true else false;

That will return true and cause a page break every fifth record.


frodoman
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

frodoman that didn't work out to well.  i do have a question.  is it possible to reference a varaible from a sub report into the main report?  i have attached a pdf of the report i am trying to work with.  notice on pages 1-2 that the report fits the 8.5X7 allowed for each office and warehouse.  notice on pages 3-4 that the report does break since more than 5 records exists in the detail section.  notice that the formatting starts to head south on pages 5-9.  i can live with that, but on page 10 it is where the problem truly starts.  notice that no break is between the details section and the next purchase order
Purchase-Order.pdf
ASKER CERTIFIED SOLUTION
Avatar of frodoman
frodoman
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

the attached pdf shows the output from the report.  up until page 5 everything looks fine.  page 5 has 40 plus entries in the detail section.  it should be placing as many entries from the details section onto page 5, but as you can see it is pushing the details section to the next page (6) and since it can't fit all in this section, it is spilling onto the 7th page.  I have a formula for the section below the detail section of the main report (numbervar rowcounter;  if rowcounter >= 5 then true else false;) i am referencing a shared numbervar "rowcounter" from the first sub report.  this numbervar performs a "count" of the entries in the detail section of the sub report (shared numbervar rowcounter;  rowcounter:= Count ({POP10110.VNDITNUM}) this formula is in the report footer section of the sub report.  the report will print on legal size paper with a perforation at the 7 inch mark.
Can someone tell me what i am missing?

Purchase-Order.pdf
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

i declared a shared variable (rowcounter)  in my sub report I placed a counter
numbervar rowcounter;
rowcounter:= rowcounter+1;

it is in my subreport footer and i tried the variable in the details section (since that is the area I want to count rows in).  still doesn't work.  Can someone tell me what or where I should be placing the variable so to get a good count and a good page break?
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

I don't see the word 'Shared' in your variable declaration?
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

i did that in the main report, do i need to do that in the sub report also?
SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Pioneermfg
Pioneermfg
Flag of United States of America image

ASKER

thank you to everyone who helped!  I finally got the page break to occur in the correct spot and life is good!
Crystal Reports
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

36K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo