Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Replace exporter dependencies with standardised Open XML SDK #45

Merged

Conversation

NealGeilen
Copy link
Collaborator

@NealGeilen NealGeilen commented Nov 29, 2022

A proof of concept is included that can be tested on multiple operating systems.

NealGeilen and others added 2 commits November 8, 2022 09:07

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* Change formats type to `string` and split with comma separator

* Use root configuration instead of configuration section

* Fix exceptions not properly displaying in the console

* Add all module item types according to documentation

* Update application demo GIF

* Create code-analysis.yml

* Remove comments and enable additional queries

* Removed push from code-analysis.yml workflow

* Typo code-analysis.yml

* Added support for a Word export option

* Added footer Epsilon Credits

* Created helper class with reformat functions

* Reformat code

* Improved helper functions, Found that they can be added to records :-)

* Reformat files

* string interpolation

* Feature/cleanup (#40)

* Remove obsolete Epsilon.Http.Abstractions project

* Fix invalid serializable implementation

* Disable unused method return value hint

* Change exception to more appropriate one

* Update Grade score description

* Prevent null grades from exporting

* Reduce cognitive complexity to acceptable level

* Move logging call

* Reduce nesting

* Move project name and repository uri to constants

* Fix nullability warnings

* Remove unused class

* Use ?: operator and move constants to top level of class

* Reduce loop complexity

* Use project name constant in output name export option

* Update README.md application demo gif

* Add supported formats to README.md

Co-authored-by: Jelle Maas <typiqally@gmail.com>
…ort-document

# Conflicts:
#	Epsilon/Epsilon.csproj
#	Epsilon/Export/Exporters/WordModuleExporter.cs
@NealGeilen
Copy link
Collaborator Author

Sorry for the Git mess. Can't really find what went wrong here.

@NealGeilen
Copy link
Collaborator Author

NealGeilen commented Nov 29, 2022

@Typiqally Could you test the word export feature on a Mac with this branch?
The code is a mess but i just wanted to know if it works.

@Typiqally
Copy link
Owner

Typiqally commented Nov 29, 2022

Sorry for the Git mess. Can't really find what went wrong here.

Maybe you didn't update your master branch on local?

@NealGeilen
Copy link
Collaborator Author

Sorry for the Git mess. Can't really find what went wrong here.

Maybe you didn't update your master branch on local?

I thought I did, But it is possible. idk

@Typiqally
Copy link
Owner

I get the following errors on macOS

Error 1
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[3]
Part: /word/document.xml
-------------------------------------------
Error 2
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[2]
Part: /word/document.xml
-------------------------------------------
Error 3
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[1]
Part: /word/document.xml
-------------------------------------------
count=3
Error 1
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[3]
Part: /word/document.xml
-------------------------------------------
Error 2
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[2]
Part: /word/document.xml
-------------------------------------------
Error 3
Description: The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:tr'. List of possible elements expected: <http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:bookmarkStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:commentRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlDelRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlInsRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:customXmlMoveToRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveFromRangeStart>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeEnd>,<http://schemas.openxmlformats.org/wordprocessingml/2006/main:moveToRangeStart>.
ErrorType: Schema
Node: DocumentFormat.OpenXml.Wordprocessing.Table
Path: /w:document[1]/w:body[1]/w:tbl[1]
Part: /word/document.xml
-------------------------------------------
count=3

I do have a document but it is filled with gibberish

@NealGeilen
Copy link
Collaborator Author

Could you share the gibberish?

I have the same errors, the table still has its headers on windows. (The goal of POC)

@Typiqally
Copy link
Owner

@NealGeilen
Copy link
Collaborator Author

Epsilon-Export-29112022130627.docx

So, At my side its correct
image

You are opening the file with word?

@Typiqally
Copy link
Owner

I'm opening the file with Pages, the standard processor for Word documents on macOS.

@NealGeilen
Copy link
Collaborator Author

NealGeilen commented Nov 29, 2022

I'm opening the file with Pages, the standard processor for Word documents on macOS.

Could you try again with the latest update? I implemented an example script from the Microsoft docs now.

The issue now is that the file can be generated by a mac. It only does not show it correctly in Pages. but it has support for the format. And why it won't show is something I don't follow. Word can read, Google Docs can read it. and my mobile can read the format. I can't find out why Pages won't accept it.

(and yes there are still errors when creating the file. regardless it works on the beforementioned platforms)

@Typiqally
Copy link
Owner

Typiqally commented Nov 29, 2022

Same issue, see screenshot:

Screenshot 2022-11-29 at 19 25 20

Maybe specifying a set width for the columns will work?

@NealGeilen
Copy link
Collaborator Author

NealGeilen commented Nov 29, 2022

Same issue, see screenshot:

Screenshot 2022-11-29 at 19 25 20

Maybe specifying a set width for the columns will work?

Yes. That's indeed something that I skipped for a POC.
Do we need to test this also for Linux? or is this good enough to continue development?

For me this is good enough and a clear sign that it will work.

@Typiqally
Copy link
Owner

Typiqally commented Nov 30, 2022

Same issue, see screenshot:
Screenshot 2022-11-29 at 19 25 20
Maybe specifying a set width for the columns will work?

Yes. That's indeed something that I skipped for a POC. Do we need to test this also for Linux? or is this good enough to continue development?

For me this is good enough and a clear sign that it will work.

I feel like if it works for macOS then it will probably work on Linux as well since they are both based on Unix. Unless they are using very specific Linux instructions or packages for some reason, but I doubt that since it is really just a fancy XML generator.

@NealGeilen NealGeilen changed the title Feat/42 use the open xml sdk to create export document Using Open XML SDK to create export document Dec 6, 2022
@NealGeilen NealGeilen changed the base branch from master to develop December 7, 2022 08:49
@NealGeilen NealGeilen removed the minor label Dec 13, 2022
@NealGeilen NealGeilen requested a review from Typiqally March 1, 2023 11:53
@NealGeilen NealGeilen marked this pull request as ready for review March 1, 2023 11:53
@NealGeilen NealGeilen added this to the Sprint [1] milestone Mar 7, 2023
…en-xml-sdk-to-create-export-document

# Conflicts:
#	Epsilon/Export/Exporters/ExcelModuleExporter.cs
#	Epsilon/Export/Exporters/WordModuleExporter.cs
@NealGeilen
Copy link
Collaborator Author

@Typiqally The PR is now complete and up to date with the main branch.

}


private static TableProperties GetTableProperties()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a constant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get this fixed without causing an error when running the application.

Epsilon/Export/Exporters/WordModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/WordModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/Exporters/ExcelModuleExporter.cs Outdated Show resolved Hide resolved
Epsilon/Export/ExportDataPackager.cs Show resolved Hide resolved
@NealGeilen NealGeilen requested a review from Typiqally March 17, 2023 13:19
@NealGeilen NealGeilen requested a review from Typiqally March 17, 2023 16:08
@Typiqally Typiqally merged commit dc7fcce into develop Mar 22, 2023
@Typiqally Typiqally changed the title Using Open XML SDK to create export document Replace exporter dependencies with standardised Open XML SDK Mar 22, 2023
@Typiqally Typiqally deleted the feat/42-use-the-open-xml-sdk-to-create-export-document branch March 22, 2023 12:26
Typiqally added a commit that referenced this pull request May 26, 2023
* Release v1.0.0 (#41)

* Change formats type to `string` and split with comma separator

* Use root configuration instead of configuration section

* Fix exceptions not properly displaying in the console

* Add all module item types according to documentation

* Update application demo GIF

* Create code-analysis.yml

* Remove comments and enable additional queries

* Removed push from code-analysis.yml workflow

* Typo code-analysis.yml

* Added support for a Word export option

* Added footer Epsilon Credits

* Created helper class with reformat functions

* Reformat code

* Improved helper functions, Found that they can be added to records :-)

* Reformat files

* string interpolation

* Feature/cleanup (#40)

* Remove obsolete Epsilon.Http.Abstractions project

* Fix invalid serializable implementation

* Disable unused method return value hint

* Change exception to more appropriate one

* Update Grade score description

* Prevent null grades from exporting

* Reduce cognitive complexity to acceptable level

* Move logging call

* Reduce nesting

* Move project name and repository uri to constants

* Fix nullability warnings

* Remove unused class

* Use ?: operator and move constants to top level of class

* Reduce loop complexity

* Use project name constant in output name export option

* Update README.md application demo gif

* Add supported formats to README.md

Co-authored-by: Jelle Maas <typiqally@gmail.com>

* POC Open XML SDK

* Update

* Add KPI format and structure

* Added module names to document

* Testing the build and structure of exel files.

* Testing release deployment script.

* Delete file

* POC for excel export

* Code reformat

* Headers added

* Code cleanup

* Merge

* Removal nullability warnings

* Removal nullability warnings

* Removal tasks/awaits because they dont have nay use atm.

* Removal tasks/awaits because they dont have nay use atm.

* 'Var' is everything

* Bugfix

* Changed foreach loop

* Refactor and cleanup code, set custom column width for Excel export

---------

Co-authored-by: Jelle Maas <typiqally@gmail.com>
Typiqally added a commit that referenced this pull request May 26, 2023
* Release v1.0.0 (#41)

* Change formats type to `string` and split with comma separator

* Use root configuration instead of configuration section

* Fix exceptions not properly displaying in the console

* Add all module item types according to documentation

* Update application demo GIF

* Create code-analysis.yml

* Remove comments and enable additional queries

* Removed push from code-analysis.yml workflow

* Typo code-analysis.yml

* Added support for a Word export option

* Added footer Epsilon Credits

* Created helper class with reformat functions

* Reformat code

* Improved helper functions, Found that they can be added to records :-)

* Reformat files

* string interpolation

* Feature/cleanup (#40)

* Remove obsolete Epsilon.Http.Abstractions project

* Fix invalid serializable implementation

* Disable unused method return value hint

* Change exception to more appropriate one

* Update Grade score description

* Prevent null grades from exporting

* Reduce cognitive complexity to acceptable level

* Move logging call

* Reduce nesting

* Move project name and repository uri to constants

* Fix nullability warnings

* Remove unused class

* Use ?: operator and move constants to top level of class

* Reduce loop complexity

* Use project name constant in output name export option

* Update README.md application demo gif

* Add supported formats to README.md

Co-authored-by: Jelle Maas <typiqally@gmail.com>

* POC Open XML SDK

* Update

* Add KPI format and structure

* Added module names to document

* Testing the build and structure of exel files.

* Testing release deployment script.

* Delete file

* POC for excel export

* Code reformat

* Headers added

* Code cleanup

* Merge

* Removal nullability warnings

* Removal nullability warnings

* Removal tasks/awaits because they dont have nay use atm.

* Removal tasks/awaits because they dont have nay use atm.

* 'Var' is everything

* Bugfix

* Changed foreach loop

* Refactor and cleanup code, set custom column width for Excel export

---------

Co-authored-by: Jelle Maas <typiqally@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Status: In review
2 participants