abpframework / abp

Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.48k stars 3.35k forks source link

DataTemplating feature #13277

Open totpero opened 2 years ago

totpero commented 2 years ago

Hi,

You have TextTemplating mechanism and this is very nice feature but this can be more generic. My scenario: I want to use TextTemplating pattern to generate Excel file or Word file.

If you rename Volo.Abp.TextTemplating.Core to Volo.Abp.DataTemplating.Core and change the ITemplateRenderer=>RenderAsync to return byte[] or Stream (not string), I can implement this interface and extend this feature to other file format.

Now I have create DataTemplating mechanism using the same pattern like TextTemplating to be more generic and I have implemented Excel Templating using Npoi and EPPlus and for Word I have implemented Templating using DocX and It can be also implemented using Npoi Word. I use the same language syntax like scriban / https://mustache.github.io/

If you want I can share this code implementation with you. I wait for your feedback about this change/feature. Thanks

maliming commented 2 years ago

hi

return byte[] or Stream (not string), will be a breaking change, I will try to find a way.

XuJin186 commented 1 year ago

@totpero That sounds great. Let me see it