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

Create Fixed Number of Rows and Pages in Crystal Reports

Status
Not open for further replies.

kg2report

IS-IT--Management
Apr 5, 2018
25
US
Hi.

If anyone can help me with this...

Scenario.

I have a Crystal Report page that needs to have a fixed number of 10 rows per page (the rows are not tied to any records). The pages; however, are tied to records based on zip codes. I also need to have a fixed number of 10 pages per zip code. Finally, for each row on each page, I need to have a counter that starts with 1 and continues to the next page until the 10th page (so 1-100 per zip code).

Any help on this would be greatly appreciated. Thanks!

kg
 
Are you creating a form that users will fill in manually? Do you need each row to have a border?

-LB
 
Yes- users will fill in manually. I've created lines to create for the columns in each row.

Thanks.

kg
 
Insert a group on zip code and place the zip code in the page header. Also place it in the detail section and suppress it. Then create a formula like this:

//{@cnt}:
whileprintingrecords;
numbervar cnt;
cnt := cnt + 1;

Place this in the detail section (suppress the group header and footer sections and the report header). Stretch the field vertically until you see a count of 10 on the first page.

Next find a table that has at least 100 records. Add it to the report but DO NOT link the table to your first table. Add a numeric field into the detail section and suppress. This will cause the fields in the first table to repeat based on the number of records in the first table. This could be a very large number, so you need to limit the records in the second table in the selection formula. If you have a field in the second table that consists of consecutive numbers, use that in the selection formula, e.g., table.ID < 101. If you only have some other numeric field, sort in ascending order and then note the value at the end of page 10 (where {@cnt} will equal 100, and then add that number into the selection formula. Format the detail section to "fit section".

If you want to add horizontal lines, add a border to the bottom and two sides of the {@cnt} formula. For the top border, insert a line in the page header and drag it down to the border.

-LB
 
PS. Forgot to mention you need to add a reset formula to the zip code group footer:

whileprintingrecords;
numbervar cnt := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top