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

Ignore Columns #4

Open
doroudi opened this issue Feb 19, 2024 · 0 comments
Open

Ignore Columns #4

doroudi opened this issue Feb 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@doroudi
Copy link
Owner

doroudi commented Feb 19, 2024

as a user, I want to be able to select which columns to export and get the export for selected columns only.

For example we have User model like this:

public class Person {
     public int Id { get; set; }
     public string FirstName { get; set; }
     public string LastName { get; set; }
     public string NationalCode { get; set; }
     public string Tel { get; set; }
}

and Mapper class:

public class ExportProfile: ExportMapper<Person>
    {
        public ExportProfile(IWorkbook workbook): base(workbook)
        {
            _ = CreateMap()
                .ForColumn("A", x => x.FirstName, opt => opt.WithHeader("Name"))
                .ForColumn("B", x => x.LastName, opt => opt.WithHeader("Family"))
                .ForColumn("C", x => x.NationalCode, opt => opt.WithHeader("National Code"))
                .ForColumn("D", x => x.Tel , opt => opt.WithHeader("Telephone"))
        }

but we just want to get Excel export with two fields FirstName and LastName

@doroudi doroudi self-assigned this Feb 19, 2024
@doroudi doroudi added the enhancement New feature or request label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant