Skip to content

FLUT-6942-FreezePanesXlsIO-Dev #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Flutter/xlsio/working-with-excel-worksheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,55 @@ File('Output.xlsx').writeAsBytes(bytes);
workbook.dispose();
{% endhighlight %}

## Freeze Panes

A portion of the worksheet can be frozen to keep it visible while scrolling through the rest of the sheet. The following code snippet shows how to create freeze panes.

{% highlight dart %}
//Create a new Excel Document.
final Workbook workbook = Workbook(1);

//Access worksheet
final Worksheet worksheet = workbook.worksheets[0];

//Set text
worksheet.getRangeByName('A1:H10').text = 'FreezePanes';

//Freeze Panes
worksheet.getRangeByName('A2').freezePanes();

//save and dispose.
final List<int> bytes = workbook.saveAsStream();
File('Output.xlsx').writeAsBytes(bytes);
workbook.dispose();
{% endhighlight %}

## Unfreeze Panes

The following code snippet explains how to remove freeze panes.

{% highlight dart %}
//Create a new Excel Document.
final Workbook workbook = Workbook(1);

//Access worksheet
final Worksheet worksheet = workbook.worksheets[0];

//Set text
worksheet.getRangeByName('A1:H10').text = 'FreezePanes';

//Freeze Panes
worksheet.getRangeByName('A2').freezePanes();

//Unfreeze the existing freeze panes
worksheet.unfreezePanes();

//save and dispose.
final List<int> bytes = workbook.saveAsStream();
File('Output.xlsx').writeAsBytes(bytes);
workbook.dispose();
{% endhighlight %}

## Right to Left Direction

A *worksheet* direction can be changed from right to left programmatically through **isRightToLeft** property of **Worksheet**. The following code snippet explains this.
Expand Down