ClosedXML / ClosedXML/ClosedXML.Report
Template doesn't recognize nested list
- Dominant language
- C#
- Stars
- 647
- Forks
- 122
- PR merge metrics
- No merged PRs in 30d
Description
I'm attempting to incorporate a nested list into my template, but it seems to be unable to recognize even the first level of nesting. Despite my thorough examination and repeated review of the documentation, I haven’t been successful. Could anyone lend a hand? I’ve included my template, code, and the resulting issue below for reference. I appreciate your help in advance!
`
var httpClient = _httpClientFactory.CreateClient("Anonymous");
using Stream calibri = await httpClient.GetStreamAsync("templates/calibri.ttf");
using Stream arial = await httpClient.GetStreamAsync("templates/arial.ttf");
LoadOptions.DefaultGraphicEngine = DefaultGraphicEngine.CreateOnlyWithFonts(
calibri,
arial
);
using var streamTemplate = await httpClient.GetStreamAsync(
"templates/CustomerReportTemplate.xlsx"
);
using var template = new XLTemplate(streamTemplate);
template.AddVariable("Customers", result?.Data);
template.Generate();
template.Workbook.Worksheets
.Worksheet(template.Workbook.Worksheets.First().Name)
.ColumnsUsed()
.AdjustToContents();
using var memoryStream = new MemoryStream();
template.SaveAs(memoryStream);
return memoryStream.ToArray();
`
[CustomerReportTemplate.xlsx](https://github.com/ClosedXML/ClosedXML.Report/files/13185471/CustomerReportTemplate.xlsx)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the report with the attached CustomerReportTemplate.xlsx and the shown XLTemplate setup, especially AddVariable("Customers", result?.Data) followed by Generate(). Inspect how the template processes nested lists and compare the generated workbook with the requested nesting behavior. Done means the first level of the nested list is recognized in the generated report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100