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

How to control the amoun of times a detail band is repeated on a page.

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
218
GB
I would like to control the amount of times a detail band is repeated on a page.

The only way I have found is to adjust the size of the footer band. But this is very delicate and sensitve to being even a few pixels too big or too small.

Thanks,
Sam

 
The Detail Band is printed for each record in the table that was 'passed' to the Report Form.

If you want more bands printed, add more records to the Report Data table/cursor.

If you are using the number of Detail Bands to control the over-all page length, you can APPEND BLANK as many times as you want to the Report Data table/cursor to get more Detail bands printed.

However, if you are doing this, you should probably use a temporary report data table/cursor so that you can add records (blank or not) and not compromise your 'true' data.

Good Luck,
JRB-Bldr
 
Can you flesh this out a bit?

From your question, as stated, it would be easy enough to create a data grouping and tick the box to start the group on a new page always.

Somehow I suspect you're doing something a little more subtle.
 
Dan,
I am using a pre-designed government form that has rows for 9 leases on the first page and 11 leases on any subsequrnt pages. Each row is .667 inches high.

Jrbbldr,
I am using a cursor and appending the necessary amount of blank records to fill the last page.

The problem I am having is that the last row on the page is either too big; or too small and then the page only has 10 records listed.

I can control it by adjusting the size of the Footer, which is unreliable because the slightest adjustment on the form may not seriously make a difference, but can change the amonut of space allowed for the detail band.

What i tried instead is using a For/Endfor loop to run REPORT FORM with a NEXT clause. This works fine except in the preview, since each page is a separate report, I cannot go forwards and/or back through the pages.

What would be nice is a setting like:

Number of times detail band is repeated on page?
 
Do you mean you want the detail band to appear a fixed number of times per page? Nine times on the first page, 11 times on subsequent pages?

If so, then you need to adjust the height of the detail band. Essentially, it needs to be one eleventh of the height of (height of page - height of header and footer bands). For the first page, add an amount to the report header equal to two detail bands.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike,

Thanks. I'll try your idea. I can't do it on the first page because it is a Governmnet designed form and the rows/detail band has to be .667 inches high.

The subsequent pages result from an instruction that says:

"Attache additional sheets if needed."

so I do have a bit more flexibility.

Thank you.
 
Over the years I have had to play some 'strange' games with my Report Forms to get them to work as needed.

One 'trick' I learned to do when there was a dramatic difference between what I needed on Page 1 and what was needed on subsequent pages was to create 2 separate Report Forms and then over-lay all of the objects from both forms into one single Report Form.

I would get Page 1 working just like I need on one Report Form.
And then I would get the other Pages working just like I need on another Report Form.

On the First Page Form I would then enter a Print When... Expression into ALL of the objects - something like PageNo = 1

On the Other Page Form I would then enter a Print When... Expression into ALL of the objects - something like PageNo > 1

Then I would create a new blank Report Form and Paste ALL of the objects from the First Page Form onto it. Followed by doing the same for ALL objects from the Other Page Form. Now I have one Report Form with 2 separate and controllable 'page' types that can be printed when it runs.

Lastly in my Report Data, I add the field matching the Print When... requirements (in this case field PageNo) and populate it as needed to get the individual records to appear on which of the 'pages' I wanted them on by merely running one REPORT FORM command.

I have no idea if this could help, but when you say that you have 9 Detail bands on Page 1 and 11 Detail bands on the other pages, I don't know if this is by intent or not.

Regardless, Good Luck,
JRB-Bldr
 
Brilliant idea JRB-Bldr,

I imagine it takes a lot of time and effort, but is undoubtedly worth it in the end.

I gave it a try, but have a long way to go to finish it.

BTW, I am using the _PAGENO System Variable to control the printing.

Thanks,
Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top