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

Allow reading from Excel documents #5

Open
jordangray opened this issue Jan 13, 2014 · 1 comment
Open

Allow reading from Excel documents #5

jordangray opened this issue Jan 13, 2014 · 1 comment
Assignees

Comments

@jordangray
Copy link
Member

Right now, the formatter can only write to Excel documents, but there's no reason it shouldn't be possible to deserialise data from an Excel document to a collection of objects.

@ghost ghost assigned jordangray Jan 13, 2014
@jordangray
Copy link
Member Author

Theoretically, this should be easy:

  1. Read data from stream into an Excel document with EPPlus.
    1. If the target type is a "simple" type, each item can be cast directly to that type.
    2. If the target type is a class, try to use headings to determine what values correspond to properties, taking into account any ExcelAttribute.Heading specified on members.
    3. If the target type is a class and there is no heading row, deserialise based on order, taking into account any ExcelAttribute.Order specified on members.
    1. If the target type doesn't implement IEnumerable, just deserialise the first non-header row into the target type.
    2. If the target type does implement IEnumerable, deserialise each row into an item of the target type's item type.

In practise, I'm certain that a dozen horrible and unanticipated scenarios will crop up—

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant