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

Fixed number of rows in a form

Status
Not open for further replies.

ikards

Technical User
Jun 16, 2000
9
US
I am trying to create a CR 9 report that looks just like an existing accounts payable claim form (boxes, lines, etc.). My client wants it to always have 8 Detail Line rows -- no matter how many actual data detail lines there are. Sometime there is only one record, sometimes 2, etc. He still wants the form to be the same length and wants me to fill in the "unused" rows with blank rows. Each form is one group so that is easy with group headers and footers with totals, but how do I "fill out" the rest of the detail lines with "blanks" before the group footer section? Thanks for any ideas.

Steve Ikard
sikard@earthlink.net
 
Insert 7 more Group Footer sections (that look like blank detail records) and suppress each one of them depending on the number of actual records in that group.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
The best way would probably be to add a table with consecutive numbers and then create a left join from that table to your current table. You could then force page breaks based on the left table every 8 records. I'm not exactly sure how well this would work, as I couldn't test it out.

Another approach would reserve the space for 8 records, but would not allow for lines around missing records. In other words, if there were only 3 records on the page and a box was drawn around the detail section, two normal sized boxes would appear, with a large third box holding the last record. If this is an adequate solution for your purposes, then you could do the following:

First, format the box to extend to the bottom of the section (alternatively you could display the three regular boxes by not checking this, and still reserve the detail space before the group footer prints).

Next go to the section expert (format->section->details->new page after->x+2) and enter:

remainder({#cntwingrp},8) = 0 //where {#cntwingrp} is a running total of records within your group with a reset on change or group

Also format the group footer by going to the x+2 area for "New page after" and entering:

Not onlastrecord

These two steps will create a page break either after 8 detail records or on change of the group.

Next create a formula {@reconpg}:

whileprintingrecords;
numbervar reconpg := reconpg + 1;

if reconpg < 8 then
replicatestring(chr(13),7-reconpg)

Place this formula in the detail section. Right click on the formula->format field->common->and check "Can Grow"

Then on the same format field screen go to suppress->x+2 and enter:

{table.groupfield} = next({table.groupfield})

This causes the formula to be suppressed on all but the last record of a group, i.e., whenever there can be less than 8 details per page.

You should now see a final box large enough for the "missing" records if you chose to format the box to extend to the bottom of the section. If you didn't, if you look in the gray area to the left of the preview screen, you should see a final large "D" section and that the group footer is low enough to allow for the "missing" records.

Not sure this will help, but maybe it will lead to a solution that meets your needs.

-LB
 
Didn't see Ido's post, which is much simpler than my suggestion...

-LB
 
may be even simpler :

-Make the group header height with a size for the header itself and eight detail lines
-check the underlay following sections property for the group in the section expert.

That's all

let me know if it works!

django
bug exterminator
tips'n tricks addict
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top