This is the second time I have written the report generation code. The last time I wrote this function, I couldn't take notes. This time I just finished writing the function and made a detailed note for later use.
Generally, we generate reports in three formats: word, excel, and pdf. Three implementations are introduced here.
1.word: use freemarker template engine technology; that is, "freemarker + xml + template";
2.excel: Use "Java + POI + Template";
3.pdf:使用“freemarker + itext + flying saucer”;
demo download: Java report generation solution