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!

Help with setting up the report (error message band 1 is too large to fit 1

Status
Not open for further replies.

Filip Brnic

Programmer
Dec 25, 2023
43
RS
I cannot make this report, its always way to big, can someone help me? it has to be on a4 paper, i dont know why it isnt making it on more pages, if someon can check this out, ive also sent a table just incase...
 

Attachments

  • helpmeprintthisplease.zip
    10.3 KB · Views: 12
Hi, Detail band, in your report, has height 50.8cm. This is very long band. You must split detail band to more detail bands or detail band with more temporary groups. How you want print band with height 50.8cm to A4 paper?!?
 
I have no clue how to split them into more bands, even when i tried that, ive made several bands and it just doesnt work, i usually find solutions and never beg for someone to do stuff for me, but can you please just adjust it somehow? Its kinda pathetic that a report has got me right : <
 
The error message saying "x is too large to fit" means that the report hasn't been told how to split that section up so it'll never fit on any single page.

When the report engine paginates a report it has to work out what bands will fit on the current page, taking into account things like, does the report have a title band, is the title band on this page, does the page header fit, after the page header how much space is left, is there are page footer that takes us any space that reduces the amount of available space, what are the printer's physical printer boundaries for the page size (A4) that have to be considered. In short, after report title, page header, page footer, report summary, group header/footers how much space for "details" does this page have and it has to asses that for each page in turn.

As it performs all these pagination calculations it knows how much space it has left and will then look at the details band or bands (or any band type for that matter) to determine if there is space for the band or bands. As it looks through the bands if there is not enough space on the current page then it flags that band for going onto the next page and moves on. It looks at the next page and starts it's calculations for that page, then assesses whether that band will fit on the next page.

If the report engine gets to a situation where the band won't fit on the current page and then the calculations say it won't fit on the next page either then to save itself from getting into an infinite loop it displays that error message because, in essence, it can't proceed as the details will not fit on any page, it wouldn't be any use trying the next page or the next page, it has hit a failure state.

In your case, you only have one details band and Detail 1 is so long > 50cm that it'll never fit on any single page of A4 so it triggers the error for the reasons explained above.

What I suggest you do is split your details into multiple bands, I can't tell you exactly how many to do, or how to arrange the report elements into those bands BUT you do need to split them up into sections. Since your report does appear to have some very obvious sections, I'd recommend splitting them up into those sections if that makes logic sense to be kept together, perhaps in the 1.1, 1.2, 1.3 sections you've got as text labels.

To do that, go to the Optional Bands section of the Report Properties and add a number of additional Details bands, I imagine you'll maybe want more than 10, maybe even more than 20, such is the busy nature of your report. Then start dragging the report elements into the bands as makes sense for your layout.

Once you've got multiple bands, and no single band is ever taller than can fit on an A4 page (given page headers, page footers, physical printer boundaries etc) then the report will be able to bump any details band that won't fit onto the current page, onto the next page and you'll stop that error occurring. It'll still be your responsibility to get the report looking OK but your #1 issue right now is to get the information spread out between multiple bands to give the report engine a fighting chance of producing any pages.

Hope that helps.

Paul
 
As an alternative, this suggestion:
Define your own page size in the report, in proportion to the A4 page, and reposition your fields. You also have to unselect the "save printer environment". Then print using a PDF creator as a PDF with the "fit to page" option. Every PDF printer should actually offer this option.
I'm currently using PDF Creator.
 
this is difficult to explain, typing one handed, but you clearly have two or more similar sections, you need one record in your, now temporary, cursor to represent each of them

number each 1.0 1.1 etc... then use condition formattinig to match the output you want...
 
It takes about 5 to 10 minutes to split the details into multiple sections as I described in my previous reply.

I split it up across 16 details sections, you could probably get away with only doing 3 or 4 if you wanted to but doing it in much smaller sections means that if you are printing multiple records and you aren't doing specific page breaks for each new record then you'll have fewer occurrences of big gaps of blank nothingness on some pages. In other words if the report engine needs to bump a section to the next page it won't leave an enormous section blank towards the bottom of the page.

Anyway, after doing the change, the report now previews the one blank record over 2 pages. Well it did after I fixed the DBF you supplied as it was missing a small number of fields referenced on the report, I think they were Predpos11, Predpos13 and Predpos15. After adding those fields the preview worked. I've zipped it back up and here it is, it's probably not perfect, maybe it could do with some slightly bigger gaps between some of the sections but you can do whatever you need to in that regard, like leaving bigger gaps at the end of each section of elements and the end of the band.

Hope that helps.
 

Attachments

  • helpmeprintthisplease_working.zip
    11.1 KB · Views: 6
Paul, first welcome to the forum and you gave a really good explanation of how to design reports.

Filip, I think we already discussed that report and its error in an older thread...

It seems the message didn't get through: VFP reports don't split bands, so if a band doesn't fit a single page, the whole report can't be printed. You have to do the splitting of the single detail band in multiple bands, there's no feature available to guide or trick VFP to split a single band. A single (detail) band is meant to print a single line, like a purchased item of an order, coming from multiple records, one per item. So what you may not realize is that the design prinpile of a detail band is not to fit all report content except header and footer, but a portion from one record of what you print.

In many cases a detail band can be more complex and cover several lines of text, printing a memo the band height can also have flexible height and grow, but if a band is already higher than can fit physically, that design can't ever work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top