Skip to content

added a (maybe partial) solution to issue 99. i wasn't able to create an appropriate test #255

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 1 commit into from
Feb 12, 2017
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions lib/stream/xlsx/worksheet-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ WorksheetWriter.prototype = {
// we _cannot_ accept new rows from now on
this._rows = null;

if (!this.startedData) {
this._writeOpenSheetData();
}
this._writeCloseSheetData();
this._writeMergeCells();

Expand Down
Binary file added spec/integration/data/test-issue-99.xlsx
Binary file not shown.
17 changes: 17 additions & 0 deletions spec/integration/issues.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ var TEST_XLSX_FILE_NAME = './spec/out/wb.test.xlsx';


describe('github issues', function() {
it('issue 99 - Too few data or empty worksheet generate malformed excel file', function() {
var testutils = require('../utils/index');
var options = {
filename: './spec/integration/data/test-issue-99.xlsx',
useStyles: true,
useSharedStrings: true
};
var wb = new Excel.stream.xlsx.WorkbookWriter(options);
var sheet = wb.addWorksheet("test");
sheet.commit();
wb.commit();

var wb2 = new Excel.Workbook();
wb2.xlsx.readFile('./spec/integration/data/test-issue-99.xlsx');
throw Error("check the file is correclty opened by excel");

});
it('issue 163 - Error while using xslx readFile method', function() {
var wb = new Excel.Workbook();
return wb.xlsx.readFile('./spec/integration/data/test-issue-163.xlsx')
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy