Objective Grid: Specifying custom page breaks

Article ID: 760
Last updated: 06 Jun, 2018
Article ID: 760
Last updated: 06 Jun, 2018
Revision: 3
Views: 1743
Posted: 22 Sep, 2006
by Meltreger B.
Updated: 06 Jun, 2018
by Meltreger B.

Problem


How do I specify custom page breaks for printing the grid?


Cause



Action


It is not directly supported, but you should be able to enable it. The key point is that all page breaks are computed in OnGridBeginPrinting().

In OnGridBeginPrinting(), call GetParam()->GetProperties()->GetRowBreakArray().Add(PrintRowArray[i]).  So, you should override the OnGridBeginPrinting method and add your row ids where the page should be broken in these arrays.

For example,

if(PageBreak)    // && m_pPlugin)
{
   for(i = 0; i < index; i++)
       GetParam()->GetProperties()->GetRowBreakArray().Add(PrintRowArray[i]);
}

Take a look at the implementation of the CGXGridCore::OnGridBeginPrinting() method in gxcore3.cpp for details.

Note: Support for custom row-wise or column-wise page breaks was added in OG 7.0.

Note: A new Page Break UI (similar to Microsoft Excel's) was added in OG 8.0. This allows the end user to set page breaks too.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 760
Last updated: 06 Jun, 2018
Revision: 3
Views: 1743
Posted: 22 Sep, 2006 by Meltreger B.
Updated: 06 Jun, 2018 by Meltreger B.

Others in this category