Skip to content
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

Invalid file when adding header row but column type is 'number' #7

Open
gozzoo opened this issue Feb 28, 2019 · 0 comments
Open

Invalid file when adding header row but column type is 'number' #7

gozzoo opened this issue Feb 28, 2019 · 0 comments

Comments

@gozzoo
Copy link

gozzoo commented Feb 28, 2019

const conf = {
    stylesXmlFile: __dirname + '/styles.xml',
    name: 'report-is-a-thing',
    cols: [
      { type: 'string', width: 15 },
      { type: 'string', width: 25 },
      { type: 'number', width: 30 }
    ],
    rows: [
      [ { value: 'First Name', style: 1 }, 
        { value: 'Last Name', style: 1 }, 
        { value: 'Age', style: 1 } ],
      ['Bruce', 'Wayne', 20],
      ['Clark', 'Kent', 25],
      ['This cell is going to be merged', '', 30],
      ['Peter', 'Parker', 35]
    ]
  };

Here the type of the third column is number but its header is obviously a string.

I think the problem could be solved if its possible for cell object to have its own type property:

{ value: 'Age', style: 1, type: 'string' }

@gozzoo gozzoo changed the title Invalid file when adding heading row but column type is 'number' Invalid file when adding header row but column type is 'number' Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant