forked from unidoc/unioffice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes unidoc#226
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2017 Baliance. All rights reserved. | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"baliance.com/gooxml/spreadsheet" | ||
) | ||
|
||
var lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin lobortis, lectus dictum feugiat tempus, sem neque finibus enim, sed eleifend sem nunc ac diam. Vestibulum tempus sagittis elementum` | ||
|
||
func main() { | ||
ss := spreadsheet.New() | ||
// add a single sheet | ||
sheet := ss.AddSheet() | ||
|
||
row := sheet.AddRow() | ||
cell := row.AddCell() | ||
|
||
rotated := ss.StyleSheet.AddCellStyle() | ||
rotated.SetRotation(45) | ||
|
||
cell.SetString(lorem) | ||
cell.SetStyle(rotated) | ||
|
||
if err := ss.Validate(); err != nil { | ||
log.Fatalf("error validating sheet: %s", err) | ||
} | ||
|
||
ss.SaveToFile("rotated.xlsx") | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters