Skip to content

Commit

Permalink
Add a new function SetColStyle for streaming writer in ja version docs
Browse files Browse the repository at this point in the history
- Add a new exported error variable ErrStreamSetColStyle
  • Loading branch information
xuri committed Feb 14, 2025
1 parent 1ea31de commit 8ac0a02
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
14 changes: 7 additions & 7 deletions en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@
* [Get default font](style.md#GetDefaultFont)
* [Streaming write](stream.md)
* [Get stream writer](stream.md#NewStreamWriter)
* [Write sheet row to stream](stream.md#SetRow)
* [Add table to stream](stream.md#AddTable)
* [Insert page break to stream](stream.md#InsertPageBreak)
* [Set panes to stream](stream.md#SetPanes)
* [Merge cell to stream](stream.md#MergeCell)
* [Set column style to stream](stream.md#SetColStyle)
* [Set column width to stream](stream.md#SetColWidth)
* [Write sheet row in stream](stream.md#SetRow)
* [Add table in stream](stream.md#AddTable)
* [Insert page break in stream](stream.md#InsertPageBreak)
* [Set panes in stream](stream.md#SetPanes)
* [Merge cell in stream](stream.md#MergeCell)
* [Set column style in stream](stream.md#SetColStyle)
* [Set column width in stream](stream.md#SetColWidth)
* [Flush stream](stream.md#Flush)
* [Data](data.md)
* [Add data validation](data.md#AddDataValidation)
Expand Down
16 changes: 8 additions & 8 deletions en/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ err := sw.SetRow("A1", []interface{}{
excelize.Cell{Value: 1}}, excelize.RowOpts{OutlineLevel: 1})
```

## Write sheet row to stream {#SetRow}
## Write sheet row in stream {#SetRow}

```go
func (sw *StreamWriter) SetRow(cell string, values []interface{}, opts ...RowOpts) error
```

SetRow writes an array to stream rows by giving starting cell reference and a pointer to an array of values. Note that you must call the [`Flush`](stream.md#Flush) function to end the streaming writing process.

## Add table to stream {#AddTable}
## Add table in stream {#AddTable}

```go
func (sw *StreamWriter) AddTable(table *Table) error
Expand Down Expand Up @@ -156,43 +156,43 @@ err := sw.AddTable(&excelize.Table{

Note that the table must be at least two lines including the header. The header cells must contain strings and must be unique. Currently only one table is allowed for a `StreamWriter`. [`AddTable`](stream.md#AddTable) must be called after the rows are written but before `Flush`. See [`AddTable`](utils.md#AddTable) for details on the table format.

## Insert page break to stream {#InsertPageBreak}
## Insert page break in stream {#InsertPageBreak}

```go
func (sw *StreamWriter) InsertPageBreak(cell string) error
```

InsertPageBreak creates a page break to determine where the printed page ends and where begins the next one by a given cell reference, the content before the page break will be printed on one page and after the page break on another.

## Set panes to stream {#SetPanes}
## Set panes in stream {#SetPanes}

```go
func (sw *StreamWriter) SetPanes(panes *Panes) error
```

SetPanes provides a function to create and remove freeze panes and split panes by giving panes options for the `StreamWriter`. Note that you must call the `SetPanes` function before the [`SetRow`](stream.md#SetRow) function.

## Merge cell to stream {#MergeCell}
## Merge cell in stream {#MergeCell}

```go
func (sw *StreamWriter) MergeCell(topLeftCell, bottomRightCell string) error
```

MergeCell provides a function to merge cells by a given range reference for the `StreamWriter`. Don't create a merged cell that overlaps with another existing merged cell.
## Set column style to stream {#SetColStyle}
## Set column style in stream {#SetColStyle}
```go
func (sw *StreamWriter) SetColStyle(minVal, maxVal, styleID int) error
```
SetColStyle provides a function to set the style of a single column or multiple columns for the `StreamWriter`. Note that you must call the `SetColStyle` function before the [`SetRow`](stream.md#SetRow) function. For example set style of column `H`:
SetColStyle provides a function to set the style of a single column or multiple columns for the `StreamWriter`. Note that you must call the `SetColStyle` function before the [`SetRow`](stream.md#SetRow) function. For example set style of column `H`:
```go
err := sw.SetColStyle(8, 8, style)
```
## Set column width to stream {#SetColWidth}
## Set column width in stream {#SetColWidth}
```go
func (sw *StreamWriter) SetColWidth(min, max int, width float64) error
Expand Down
1 change: 1 addition & 0 deletions ja/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
* [ストリームに改ページを挿入](stream.md#InsertPageBreak)
* [ストリームによるペインの設定](stream.md#SetPanes)
* [ストリームでマージセル](stream.md#MergeCell)
* [ストリームの列スタイルを設定する](stream.md#SetColStyle)
* [ストリームの列幅を設定する](stream.md#SetColWidth)
* [エンディングストリーム](stream.md#Flush)
* [データ](data.md)
Expand Down
12 changes: 12 additions & 0 deletions ja/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ func (sw *StreamWriter) MergeCell(topLeftCell, bottomRightCell string) error

指定されたセル座標範囲を使用してセルをストリーミングすると、現在、重なり合うセル以外のセルの結合のみがサポートされます。

## ストリームの列スタイルを設定する {#SetColStyle}

```go
func (sw *StreamWriter) SetColStyle(minVal, maxVal, styleID int) error
```

SetColStyle は、`StreamWriter` の単一列または複数列のスタイルを設定する関数を提供します。[`SetRow`](stream.md#SetRow) 関数の前に `SetColStyle` 関数を呼び出す必要があることに注意してください。たとえば、列 `H` のスタイルを設定するには、次のようにします。

```go
err := sw.SetColStyle(8, 8, style)
```

## ストリームの列幅を設定する {#SetColWidth}

```go
Expand Down
2 changes: 2 additions & 0 deletions ja/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ var (
ErrSparklineStyle = errors.New("parameter 'Style' must between 0-35")
// ErrSparklineType は、無効なスパークラインの Type パラメーターを受信したときのエラーメッセージを定義しました
ErrSparklineType = errors.New("parameter 'Type' must be 'line', 'column' or 'win_loss'")
// ErrStreamSetColStyle は、ストリーム書き込みモードでの列スタイル設定に関するエラー メッセージを定義します
ErrStreamSetColStyle = errors.New("must call the SetColStyle function before the SetRow function")
// ErrStreamSetColWidth は、ストリーム書き込みモードでの列幅の設定に関するエラーメッセージを定義しました
ErrStreamSetColWidth = errors.New("must call the SetColWidth function before the SetRow function")
// ErrStreamSetPanes は、ストリーム書き込みモードのセット ペインでのエラー メッセージを定義しました
Expand Down

0 comments on commit 8ac0a02

Please sign in to comment.