![gembox help structure gembox help structure](https://i.stack.imgur.com/BYoK7.png)
But it would be so large that I don't even know if it would work in a proper manner.“ Enterprise potential of Russia and Belgium: the comparative analysis of environment for early entrepreneurship activities (based on "Global Entrepreneurship Monitor" APS data, 2006-2007)”Įspecially globalization process makes important the still existing disparities in entrepreneurship framework conditions between Western Europe and some emerging market economies like Russia (including SME). As well as sending it all to some TinyMCE editor and make them edit it there themselves. I have thought about different approaches, like creating a razor page and do all styling with html and css and then export that document, since I'm more comfortable working with html and css. I needed some more facts of what is possible and what's not, so that I could bring this back to my client before digging into that OpenXML world again.
Gembox help structure code#
The code generated to meet these requirements with OpenXML is such a large spaghetti, that I wanted to see if there are any better way to export to word than using OpenXML. But then it comes to the export part that I've now styled using OpenXML, but having a class with methods over 3000 lines long isn't manageable. So all I get in the backend is an ID and I have to rebuild the whole thing, which I've done. So it's not possible to export everything in one go from the frontend, that would also be very large to send over the wire. The structure is created by combining data from several microservices with integrations to other applications. Then when they are done they want to export it, I can't go into detail what the documents are for but they are mandatory. Ok, so basically they are building the structure in a web app by dragging/dropping nodes and creating complex inheritances. Even if I splitted it up in several methods it's just a mess. Imagine how mine looks with tables, colors, text formats etc. Just look at the code example, that's like 60 lines of code just to create a plain text header. I don't understand how I would create it dynamically and different for some pages. From what I've read in the header doc I can create it for even, odd and every page. After that I loop out all the structures and using OpenXML to apply the styling, but I can't get the headers to work properly. Right now I have one initial template made that I read in and replace some of the values that are static, just to get something started. And in the end I merge all these documents into one that is the complete document. That would mean I need different docx files created for every scenario, that I would read in as a template based on X and Y conditions.
![gembox help structure gembox help structure](https://i.ytimg.com/vi/z3qb3eezfL8/hqdefault.jpg)
I would be able to create templates with placeholders that I would just target and replace. I meant since the header needs to be different for some parts of the document. I saw that ClosedXML package, but it seemed to be only for excel. Is there any easier way to work with exports to Word that is free? Even paid solutions might be suggested since I could bring that back to my client. Though I don't really know if it's a good idea. I had another plan of creating the templates for each possible outcome, and then chose that template for the current node and in the end merge all documents together into one. If more demands will be added later it would be close to impossible to make any major adjustments without having to start over.
![gembox help structure gembox help structure](https://www.gemboxsoftware.com/document/examples/503/content/Iterating.png)
But there is so much code generated to make a simple task, that the code base for this export starting to get out of hand. I've now dugged down into OpenXML and working with the OpenXML Productivity Tools. Is it even possible to create a different header per page? But the rendering needs to be dynamic, headers have different colors, text should appear in certain orders if X is true, the header needs to be different for each page. Initially I created a template and replaced words, which was fine for some parts. My client wants this exported as a word document, since they need to be able to edit it. So I have a root object with properties that has a list of children and those may have a list of childrens aswell, could be down to 6+ levels deep. I have a very large nested structure that I'm building up on the server side from JSON to C# when getting the export call.