Polishing the group footer printing


There might be cases in which a group header is printed in one page but the details begins in a new page, because there was not room for the details order.
For example:
2018 03 07 12H19 05

In order to avoid it you can ask the code to check if there is enough room to print - we need to make sure that both the details and the page footer have enough space.
In the code it will look like this:

public Print_Orders()
{
    Groups[Orders1.ShipCity].Enter += () =>
    {
        if (_Printer.HeightUntilEndOfPage < _layout.Body.Height + _layout.GroupLeave.Height)
            _ioPrint_Order.NewPage();
        _layout.Customer.WriteTo(_Printer);
        OrdersPerCity.Value = 0;
    }; 

And this is the result:
2018 03 07 13H55 03


Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com