Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template doesn't recognize nested list #333

Open
kyo1506 opened this issue Oct 27, 2023 · 0 comments
Open

Template doesn't recognize nested list #333

kyo1506 opened this issue Oct 27, 2023 · 0 comments

Comments

@kyo1506
Copy link

kyo1506 commented Oct 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant