Freeze and Split Panes

The following example shows how you can create worksheet panes. Panes can be frozen, split and frozen/split.

Note that some values of PanePosition enumeration are invalid if the pane doesn't exist in the split.

Excel frozen and split panes set with GemBox.Spreadsheet for Java
Screenshot of Excel frozen and split panes set with GemBox.Spreadsheet for Java
import com.gembox.spreadsheet.*;

class Program {

    public static void main(String[] args) throws {
        // If using Professional version, put your serial key below.

        ExcelFile workbook = new ExcelFile();

        // Frozen Rows (first 2 rows are frozen)
        ExcelWorksheet worksheet1 = workbook.addWorksheet("Frozen rows");
        worksheet1.setPanes(new WorksheetPanes(PanesState.FROZEN, 0, 2, "A3", PanePosition.BOTTOM_LEFT));

        // Frozen Columns (first column is frozen)
        ExcelWorksheet worksheet2 = workbook.addWorksheet("Frozen columns");
        worksheet2.setPanes(new WorksheetPanes(PanesState.FROZEN, 1, 0, "B1", PanePosition.TOP_RIGHT));

        // Frozen Rows and Columns (first 2 rows and first 3 columns are frozen)
        ExcelWorksheet worksheet3 = workbook.addWorksheet("Frozen rows and columns");
        worksheet3.setPanes(new WorksheetPanes(PanesState.FROZEN, 3, 2, "E5", PanePosition.BOTTOM_RIGHT));

        // Split pane
        ExcelWorksheet worksheet4 = workbook.addWorksheet("Split pane");
        worksheet4.setPanes(new WorksheetPanes(PanesState.SPLIT, 2310, 1500, "D7", PanePosition.BOTTOM_RIGHT));"Freeze or Split Panes.%OutputFileType%");

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.

Like it?

Download Buy

If you want to try the GemBox.Spreadsheet for Java yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.