Esempio n. 1
0
        public void Render <TModel>([NotNull] ITableBuilder tableBuilder, [NotNull] TModel model)
        {
            var renderingTemplate = templateCollection.GetTemplate(rootTemplateName)
                                    ?? throw new InvalidOperationException($"Template with name {rootTemplateName} not found in xlsx");

            tableBuilder.CopyFormControlsFrom(templateTable);
            tableBuilder.CopyDataValidationsFrom(templateTable);
            tableBuilder.CopyWorksheetExtensionListFrom(templateTable); // WorksheetExtensionList contains info about data validations with ranges from other sheets, so copying it to support them.
            tableBuilder.CopyCommentsFrom(templateTable);
            var render = rendererCollection.GetRenderer(model.GetType());

            render.Render(tableBuilder, model, renderingTemplate);
        }