sections using space even if they arent printed

hi there. ive got a strange problem with reports, as usual: i have a table with some records and a field “Type”. type has 5 options. now my report has 1 dataitem and 5 sections, one for each type, and simply prints out the records. the sections have different heights (from 490 to 21440). lets say, i got 23 recs with type=1 (490 high) and 1 rec of type=2 (21440 high). on one page there is room for 20 recs of type 1. now if i print out the report, he prints me only 5 recs of type 1 and then starts a new page, continuing with other 5 recs of type 1 a.s.o. it seems that nav reserves the space for the rec with type=2, even if the section is not printed (OnPreSection: if type<>2 then curreport.showoutput(false)). so i get 5 pages even if 2 would be enough having on the first 4 pages only 5 lines and on the last, the section of type 2. has onyone got a trick to solve that?

quote:


Originally posted by ahed4
hi there. ive got a strange problem with reports, as usual: i have a table with some records and a field “Type”. type has 5 options. now my report has 1 dataitem and 5 sections, one for each type, and simply prints out the records. the sections have different heights (from 490 to 21440). lets say, i got 23 recs with type=1 (490 high) and 1 rec of type=2 (21440 high). on one page there is room for 20 recs of type 1. now if i print out the report, he prints me only 5 recs of type 1 and then starts a new page, continuing with other 5 recs of type 1 a.s.o. it seems that nav reserves the space for the rec with type=2, even if the section is not printed (OnPreSection: if type<>2 then curreport.showoutput(false)). so i get 5 pages even if 2 would be enough having on the first 4 pages only 5 lines and on the last, the section of type 2. has onyone got a trick to solve that?


Which kind of section are they? Footer sections behave just like that. Since Navision can’t predict when the space for footers will be needed it leaves it on every page. The only way to solve this problem is to use instead body sections. Anna

those are all bodies. each body has a OnPreSection where there is decided if they are printed or not. now i tried something else: instead of making a section for each type, i made a dataitem for each type of type Integer and with tableview = number=Const(1). and now the decision is made this way OnPreDataitem if type<>0 then CurrReport.break. and i added 1 section only per dataitem. always bodies. doesnt work either. thats strange, because if i call a break in OnPreDataitem, the dataitem isn processed in any way, or am i wrong?

just in case anyone wants to know what the problem is: http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=4073&SearchTerms=report,section,new,page and read the last 2 comments carefully =) just an addition from my side: dont try to do that with a 2.60 client. it just WONT work. use 3.70 or 3.60 and it should do the job. but now i wonder how i could solve that thing on a 2.60 environment [?]

We’ve worked around this problem before as follows: 1) Specify a DataItemTableView for the DataItem; 2) Name the low-order field of the SORTING in the GroupTotalField property; 3) Use a GroupFooter section instead of a Body (resulting in a GroupFooter per record…). It may be ugly, but it worked!