Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detail2 page prints even when there are no detail2 data
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01321887
Message ID:
01322588
Views:
15
>>I have also tried to force the textual data to occupy all space on page 1, by creating one dummy object that absorbs all remaining white space, but somehow I did not succeed. Perhaps you know the trick to do this?
>
>The trick is to put a tiny shape at the end of the band and put a special "directive" on that shape. In the directive class for that shape, use the AdjustObjectSize method to alter the height of the shape to be equal to the MaxheightAvailable property + 1. That makes the report writer think that the shape won't print so it goes to the next page. Then use the Render method to tell it NOT to print the shape.
>
>I also use a similar trick on pictures. If you design the report with a large picture image, and not every record has a picture, you can end up wasting space at the bottom of the page. The workaround is to create the image object very tiny .. then use the directive concept and the AdjustObjectSize method to expand the size of the image to what you want. The report writer will print the larger size .. and it's smart enough to know to go to the next page if it needs to.

As promised in my other reply, I again tried the tiny shape principle.

Okay, this time it appears to work. I created a tiny shape, set its Style to None. It 'prints' only when there are pictures for the detail2 band. The detail2 band no longer has 'Start on new page' set to True. On the Dynamics tab of the shape I added a condition, named Resizer. In the Height Expression I have put the text:
m.oProps.MaxHeightAvailable + 1
It forces the engine to go to the next page. The funny thing is that the shape's height is then set back to its original value, which is only some pixels in my case! The shape is 'printed', but not visibly because of its style. Then the first picture is printed. Voila. Job done. Although when reading the script I don't understand how this happens.

Thanks for the hints!


And now it's time for the soccermatch Netherlands - Italy. :)
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform