Base solution for your next web application
Open Closed

Reading Excel for 2nd time giving issue during import #10421


User avatar
0
huntethan89 created
  • What is your product version? "10.2.0"
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core

Hi,

I am trying to read excel from your inbuilt method. It is working succesfully for first time but when i tried to read the excel it is giving following error. Can you please look into this?

i checked the row data when reading first time as follows:-

Wheni read the excel 2nd time i checked the row data as follow:-

As you can see, i have highlighted the part in both images. 2nd time it pick the date cell is some error format due to which we are getting error.

Please check this and let us know.

This is the method where we are getting error during the cell data.

Thanks


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you apply changes in this PR https://github.com/aspnetzero/aspnet-zero-core/pull/3923/files and see if it fixes your problem ?

  • User Avatar
    0
    huntethan89 created

    Hi,

    I have tried and found the solution you shared did not help us.

    When user import excel first time it works fine but whenever user tries to upload same excel with different data or same data it unable read few columns specifically DATETIME type columns and throws null reference error on following line:-

    cellValue = formatter.FormatCellValue(worksheet.GetRow(row).GetCell(column));

  • User Avatar
    0
    musa.demir created

    Hi @smartlayer Since your DateFormatter implementation does not exist in zero, I can not try to produce your problem. The current implementation is a little bit different(see here: https://github.com/aspnetzero/aspnet-zero-core/blob/5e9ca60d4f3710f3cbe40340362ed542d7ebcaf4/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Authorization/Users/Importing/UserListExcelDataReader.cs#L80-L100). Can you please check if it suits your requirements? If not, can you please share your implementation so that I can try it?