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)
-
0
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 -
0
Thanks for all.
-
0
-
0
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.
-
0
-
0
Everything's fine now. It was my mistake. Thanks.