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

How to setup excel format when usng 2 binding list #371

Open
ldprenzy opened this issue Nov 29, 2024 · 2 comments
Open

How to setup excel format when usng 2 binding list #371

ldprenzy opened this issue Nov 29, 2024 · 2 comments

Comments

@ldprenzy
Copy link

Hi, I'm trying to setup 2 diffent table report format but I cant seem to figure out how to setup the excel define names.

this is the excel format that im trying to achieve
Excel

Im using Zip items which working perfectly but I cant find a way to make it work on the excel file
public IEnumerable ZipItemsAndDiscounts(List items, List discounts)
{
var maxCount = Math.Max(items.Count, discounts.Count);

        for (var i = 0; i < maxCount; i++)
        {
            yield return new ItemAndDiscount
            {
                Item = (i < items.Count ? items[i] : null),
                Discount = (i < discounts.Count ? discounts[i] : null)
            };
        }
    }

here is the sample output base on the setup that ive tried
Sales_Order (5).xlsx
Sales_Order (4).xlsx

@CongThai-NTQSolution
Copy link

Hi @ldprenzy, you can try define names as this https://closedxml.io/ClosedXML.Report/docs/en/Flat-tables

@ldprenzy
Copy link
Author

Hi @ldprenzy, you can try define names as this https://closedxml.io/ClosedXML.Report/docs/en/Flat-tables

Hi. Yes, I already tried that one. but the binding data only caters 1 table define name in a report format. in my case I have two separate table in 1 report format and I cant apply the same Define Name to the other table.

Well, Since Its not working on my end I have tried different approach instead of using XLTemplate I used XLWorkbook to cater the setup of my report format.

feel free to drop more suggestion. Thanks.

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

2 participants