Open Closed

Import Excel file #9313


User avatar
0
antoni.obrados created

Hi everyone,

I've already imported an Excel file using the Abp Boilerplate framework, but I can't figure out how to do it with abp.io. Could you tell me how to do it?

Thanks.


6 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    We're using MiniExcel library in ABP Suite to export data as excel whenever you generate a code by checking Enable Excel Export option.

    You can use the same library to import too

    public async Task ImportAsync(IRemoteStreamContent file)
    {
        using var stream = file.GetStream();
        var rows = stream.Query<BookExcelDto>().ToList();
    
        var bookList = rows.Select(row => new Book(row.Id, row.Title, row.AuthorName)).ToList();
    
        await _bookRepository.InsertManyAsync(bookList);
    }
    

    You can read this article if you want to learn usage of IRemoteStreamContent and upload a file from angular: https://abp.io/community/articles/how-to-upload-and-download-files-in-the-abp-framework-using-angular-que8cdr8

  • User Avatar
    0
    antoni.obrados created

    Thanks for all.

  • User Avatar
    0
    antoni.obrados created

    Hi,

    When I run swagger it gives me this error:

    Thanks.

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hello,

    Can you send us the logs of your application to pinpoint the root cause of the problem?

    You can find the log record in Logs/logs.txt in the Host project.

    Thanks.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi,

    When I run swagger it gives me this error:

    Thanks.

    Do you use a gateway or directly calling the service?

    Also please check logs of the application it provide information about the problem. You can share with us the logs

  • User Avatar
    0
    antoni.obrados created

    Everything's fine now. It was my mistake. Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37