Skip to content

Ignore Columns #4

@doroudi

Description

@doroudi

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions