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

Repeat a section to the end of a page so it will be filled 1

Status
Not open for further replies.

saied

Programmer
Jan 17, 2007
7
US
Scenario:

Lets say that a page can fit a maximum 50 rows of data. What I basically want to do is if there are 25 rows returned, I want to print 25 blank rows beneath the 25 returned so a whole page will be filled.

I don't know how many rows will be returned, so is there some way to tell Crystal to print a certain section until the end of the page.

Thanks,
Saied
 
Can you explain the context for this? The page will already be blank, so why do this? Why not use page breaks to ensure the rest of the page is blank if this is the issue?

-LB
 
Assume you have a summation that you want to display at the bottom of the page. I know that you can print a section at the bottom of the page using the section expert, but lets say you want to print empty rows between the rows that were returned and the summation at the end, so it will not be blank in between when you preview or print it.
It's actually not going to be blank space, it will be grid rows made up of a box object and line objects.

For example, instead of this

Data
Data


Summation

I want this

Data
Data
--------
--------
--------
Summation
 
If you are using lines and boxes, then you would have to insert additional detail sections containing these objects. Create a variable to count your actual records on the page, and then use a formula to suppress unnecessary detail sections based on the total possible lines per page - the actual.

If you only wanted the appearance of lines, you could create this in a formula, where you identify the last record (in the group?) and then insert returns and underlines, again using the running total variable as a guide to how many returns are necessary, e.g.,

You would have a formula in the page header:
//{@reset}:
whileprintingrecords;
numbervar cnt := 0;

In the detail section you would have:
//{@cnt}:
whileprintingrecords;
numbervar cnt := cnt + 1;

//{@field}:
numbervar cnt;
if onlastrecord or
{table.groupfield} <> next({table.groupfield}) then
{table.string} + replicatestring(chr(13)+"________",50-cnt) else
{table.string}

You would use this last formula instead of one of your recurring fields and you would format the formula to "can grow". This assumes you have a new page after on the group footer and that you have 50 lines per page (adjust as necessary).

-LB
 
Well, my example was just for lines, but it is actually a box with a solid border and vertical lines to make the appearance of a grid. This is also in a subreport.
 
WHAT is in a subreport?

You might also try adding a grid to a page header section that is stretched to cover the entire page, then format this to "underlay following sections". In a subreport, you would need to create a fake page header by creating a formula like this:

whilereadingrecords;
1

Insert a group on this and format it to repeat group header on each page. Remove the group name and use this for your grid.

-LB
 
The actual grids are are in a sub-report. The data is in a sub-report.
 
What do you mean by create a fake page header?
 
In the subreport, you can create a fake page header by following the steps in my last post.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top