EasyXLS™ library allows you to freeze worksheet panes for Excel files. The library permits you to freeze the report column headers for an Excel report, for example.
This Excel component also allows you to split worksheet panes for Excel files. By choosing the split option the worksheet is split in two views.
// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument workbook = new ExcelDocument(2);
// Get the table of data for the first sheet
ExcelTable xlsFirstTable =
((ExcelWorksheet)workbook.easy_getSheetAt(0)).easy_getExcelTable();
...
// Freeze panes
xlsFirstTable.easy_freezePanes(1, 0, 75, 0);
...
// Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx");
' Create an instance of the class that exports Excel files, having two sheetsDim workbook As New ExcelDocument(2)
' Get the table of data for the first sheetDim xlsFirstTab As ExcelWorksheet = workbook.easy_getSheetAt(0)
Dim xlsFirstTable = xlsFirstTab.easy_getExcelTable()
...
' Freeze panes
xlsFirstTable.easy_freezePanes(1, 0, 75, 0)
...
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\Excel freeze pane.xlsx")
C++// Create an instance of the class that exports Excel files
EasyXLS::IExcelDocumentPtr workbook;
hr = CoCreateInstance(__uuidof(EasyXLS::ExcelDocument),
NULL,
CLSCTX_ALL,
__uuidof(EasyXLS::IExcelDocument),
(void**) &workbook) ;
// Get the table of data for the first sheet
EasyXLS::IExcelWorksheetPtr xlsFirstTab =
(EasyXLS::IExcelWorksheetPtr)workbook->easy_getSheetAt(0);
EasyXLS::IExcelTablePtr xlsFirstTable = xlsFirstTab->easy_getExcelTable();
...
// Freeze panes
xlsFirstTable->easy_freezePanes_2(1, 0, 75, 0);
...
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx");
Click here to see Continuous Code ListingC++.NET// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument ^workbook = gcnew ExcelDocument(2);
// Get the table of data for the first sheet
ExcelWorksheet ^xlsFirstTab =
safe_cast<ExcelWorksheet^>(workbook->easy_getSheetAt(0));
ExcelTable ^xlsFirstTable = xlsFirstTab->easy_getExcelTable();
...
// Freeze panes
xlsFirstTable->easy_freezePanes(1, 0, 75, 0);
...
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx");
Click here to see Continuous Code Listing
// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument workbook = new ExcelDocument(2);
// Get the table of data for the first sheet
ExcelTable xlsFirstTable =
((ExcelWorksheet)workbook.easy_getSheetAt(0)).easy_getExcelTable();
...
// Freeze panes
xlsFirstTable.easy_freezePanes(1, 0, 75, 0);
...
// Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx");
.NET:// Create an instance of the class that exports Excel files
$workbook = new COM("EasyXLS.ExcelDocument");
// Get the table of data for the first sheet
$xlsFirstTable = $workbook->easy_getSheetAt(0)->easy_getExcelTable();
...
// Freeze panes
$xlsFirstTable->easy_freezePanes_2(1, 0, 75, 0);
...
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\Excel freeze pane.xlsx");
Click here to see Continuous Code ListingJava:// Create an instance of the class that exports Excel files
$workbook = new java("EasyXLS.ExcelDocument");
// Get the table of data for the first worksheet
$xlsFirstTable = $workbook->easy_getSheetAt(0)->easy_getExcelTable();
...
// Freeze row
$xlsFirstTable->easy_freezePanes(1, 0, 75, 0);
...
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\Excel freeze pane.xlsx");
Click here to see Continuous Code Listing
' Create an instance of the class that exports Excel filesSet workbook = Server.CreateObject("EasyXLS.ExcelDocument")
' Get the table of data for the first sheetSet xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
...
' Freeze panes
xlsFirstTable.easy_freezePanes_2 1, 0, 75, 0
...
' Export Excel file
workbook.easy_WriteXLSXFile ("C:\Samples\Excel freeze pane.xlsx")
' Create an instance of the class that exports Excel filesSet workbook = CreateObject("EasyXLS.ExcelDocument")
' Get the table of data for the first sheetSet xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
...
' Freeze panes
xlsFirstTable.easy_freezePanes_2 1, 0, 75, 0
...
' Export Excel file
workbook.easy_WriteXLSXFile ("C:\Samples\Excel freeze pane.xlsx")
' Create an instance of the class that exports Excel filesset workbook = CreateObject("EasyXLS.ExcelDocument")
' Get the table of data for the first sheetset xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
...
' Freeze panes
xlsFirstTable.easy_freezePanes_2 1, 0, 75, 0
...
' Export Excel file
workbook.easy_WriteXLSXFile ("C:\Samples\Excel freeze pane.xlsx")
<!-- Create an instance of the class that exports Excel files --><cfobject type="java"class="EasyXLS.ExcelDocument"name="workbook"action="CREATE"><!-- Get the table of data for the first sheet --><cfset xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()>
...
<!-- Freeze panes --><cfset xlsFirstTable.easy_freezePanes(1, 0, 75, 0)>
...
<!-- Export Excel file --><cfset ret = workbook.easy_WriteXLSXFile("C:\Samples\Excel freeze pane.xlsx")>
.NET:# Create an instance of the class that exports Excel files having two sheets
workbook = ExcelDocument(2)
# Get the table of data for the first worksheet
xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
...
# Freeze row
xlsFirstTable.easy_freezePanes(1, 0, 75, 0)
...
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx")
Click here to see Continuous Code ListingJava:# Create an instance of the class that exports Excel files having two sheets
workbook = gateway.jvm.ExcelDocument(2)
# Get the table of data for the first worksheet
xlsFirstTable = workbook.easy_getSheetAt(0).easy_getExcelTable()
...
# Freeze row
xlsFirstTable.easy_freezePanes(1, 0, 75, 0)
...
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel freeze pane.xlsx")
Click here to see Continuous Code Listing
The screen shot below represents an exported Excel report with freeze panes.
Freeze panes
EasyXLS enables you freeze panes for an Excel worksheet by using ExcelTable.easy_freezePanes method. The above code sample shows how to achieve this goal.
Split panes
EasyXLS enables you split panes for an Excel worksheet by using ExcelTable.easy_split method.
Add data into sheets
EasyXLS enables you to populate the sheets with data. The supported data types are strings, numbers, dates, booleans, errors and formulas.