Skip to content

Commit

Permalink
xlsx: Chinese characters, multiline cells
Browse files Browse the repository at this point in the history
  • Loading branch information
John Juback committed Sep 3, 2021
1 parent fe81643 commit 4778522
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 3.0.44 (September 3, 2021)
Fixed issue where Chinese characters were rendered as HTML entity markup in .xlsx files.

Multiline cells are now displayed properly in .xlsx files.

## 3.0.43 (August 20, 2021)
Fixed issue where persistent previews ignored changes to column structure in the underlying CSV file. Formerly, it was necessary to execute the `CSV: Clear Preview State` command to view the changes.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ For files with a .csv, .tsv, or .tab extension, use the explorer context menu or

For .tsv and .tab files, a tab delimiter is assumed. For plain text files with different extensions, open the file in an editor and execute the `CSV: Open Preview` command from the command palette.

> *CSV files only*: To specify a secondary sort column, hold the `Shift` key while clicking its column header. To undo sorting for a column, hold the `Ctrl` key while clicking its column header. Alternatively, you can use the `CSV: Clear Preview State` command to remove all sort/filter criteria for the current file.
## Excel Usage
For files with an .xlsx or .xlsm extension, use the explorer context menu or editor title menu to invoke the `Open Preview` command. The contents of the file will be displayed in a [FlexSheet](http://demos.wijmo.com/5/Angular/FlexSheetExplorer/FlexSheetExplorer/#/intro) control. If multiple sheets are present, use the controls at the bottom of the view for navigation.

Expand Down
12 changes: 12 additions & 0 deletions out/excel.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ function initPage() {
}
}

// http://jsfiddle.net/Wijmo5/2a20kqvr/
function autoSizeVisibleRows(flex, force) {
var rng = flex.viewRange;
for (var r = rng.row; r <= rng.row2; r++) {
if (force || flex.rows[r].height == null) {
flex.autoSizeRow(r, false);
}
}
}

var news = wijmo.getElement("[wj-part='new-sheet']");
news.parentElement.removeChild(news);

Expand All @@ -62,6 +72,7 @@ function initPage() {
}, true);

sheet.loaded.addHandler(() => {
sheet.columns.forEach(c => c.isContentHtml = c.multiLine = true);
var style = getSheetStyle(sheet);
sheet.sheets.forEach(s => {
s.tables.forEach(t => {
Expand All @@ -75,6 +86,7 @@ function initPage() {

setTimeout(() => {
sheet.autoSizeColumn(0, true);
autoSizeVisibleRows(sheet, true);
}, 0);

sheet.filter.filterApplied.addHandler(() => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gc-excelviewer",
"displayName": "Excel Viewer",
"description": "View Excel spreadsheets and CSV files within Visual Studio Code workspaces.",
"version": "3.0.43",
"version": "3.0.44",
"icon": "img/gc-excelviewer.png",
"publisher": "GrapeCity",
"license": "SEE LICENSE IN LICENSE.txt",
Expand Down

0 comments on commit 4778522

Please sign in to comment.