The invention provides a dynamic header rendering method and
system based on EasyExcel, and belongs to the technical field of
data export and
report generation. During export, an export request containing a service type and a request parameter is received, a
callback address, a request mode and header field configuration are read from a
database according to the service type, and an export report is generated; the field configuration at least comprises a field key, a field name, a
data type and sorting information, and can comprise a header hierarchy and a style merging rule; the
system constructs a header
list required by EasyExcel, obtains service data according to
callback configuration and converts the service data into Listt; mapt, Mapt; the method comprises the following steps of: (1) carrying out String, Objectgt Gt; and the form and the header field key are dynamically matched and written. An Excel file is generated in a
paging writing mode so as to reduce memory occupation, and finally the file is stored in an
object storage and returned to a downloading address. The method supports quick adjustment of the multi-task type header, reduces code modification and repeated model class maintenance, and improves the export stability of large data volume.