ExcelMapper icon indicating copy to clipboard operation
ExcelMapper copied to clipboard

combo properties leads to empty excel

Open MannusEtten opened this issue 1 year ago • 3 comments

    var excel = new ExcelMapper()
    {
        HeaderRow = false,
        MinRowNumber = 3
    };

    try
    {
        excel.Save(_fileName, serviceItems);
    }

the list of service items is filled with 50 items, without the properties of HeaderRow and MinRowNumber there is a sheet coming with headers and 50 rows

in this case I get empty sheets I do have a prepared Excel-sheet with column names and conditional formatting, I would like to add my records to it so that is why I use the minRowNumber so it will skip the first 2 rows with my column information.

But it produces now empty sheets....

MannusEtten avatar Mar 28 '24 07:03 MannusEtten

Have you tried setting CreateMissingHeaders to true?

I'm not sure I understand your use case. Do you have a template, i.e. an existing Excel file that you want to fill? If so, you'll need to load it into the instance of ExcelMapper that you're using to save by either loading the Excel file or passing a Workbook object into it.

mganss avatar Mar 28 '24 17:03 mganss

i do have existing excel , i tried it as well with loading the excel-spreadsheet, it does not fill any record. Because my header is 2 rows instead of 1 i set the property MinRowNumber to 3

MannusEtten avatar Mar 28 '24 18:03 MannusEtten

Can you attach an example Excel file here?

mganss avatar Apr 09 '24 11:04 mganss