From c89d84235238f1e2a37b03551ca6ef652c2f3769 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Thu, 8 Jun 2017 11:11:11 +0800 Subject: Init auto filter support, relate issue #59. --- rows.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 52a360c..3f90dcb 100644 --- a/rows.go +++ b/rows.go @@ -148,3 +148,27 @@ func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) { return f.formattedValue(xlsx.S, xlsx.V), nil } } + +// HideRow provides a function to set hidden of a single row by given worksheet index and row index. For example, hide row 3 in Sheet1: +// +// xlsx.HideRow("Sheet1", 2) +// +func (f *File) HideRow(sheet string, rowIndex int) { + xlsx := f.workSheetReader(sheet) + rows := rowIndex + 1 + cells := 0 + completeRow(xlsx, rows, cells) + xlsx.SheetData.Row[rowIndex].Hidden = true +} + +// UnhideRow provides a function to set unhidden of a single row by given worksheet index and row index. For example, unhide row 3 in Sheet1: +// +// xlsx.UnhideRow("Sheet1", 2) +// +func (f *File) UnhideRow(sheet string, rowIndex int) { + xlsx := f.workSheetReader(sheet) + rows := rowIndex + 1 + cells := 0 + completeRow(xlsx, rows, cells) + xlsx.SheetData.Row[rowIndex].Hidden = false +} -- cgit v1.2.1