The excel generated by java poi cannot be previewed after sending an email

There is a demand in the work. Use spark to query the business summary data every day, generate an excel report, and send it to the people who need it.

The code generation excel part uses poi, and the mail is sent using javaMail

You can find information on the Internet by sending emails and producing excel, and quickly realized the basic work order, but found that the email attachment excel click preview is a blank page, and it is no problem to download it to the local and open it.

 

 After trying for a long time, I found that there is no problem using XSSFWorkbook to generate when generating excel, instead of using SXSSFWorkbook to generate.

Because the code for generating excel is also found online, it is not clear why I started using SXSSFWorkbook

 

Guess you like

Origin www.cnblogs.com/nmcc33/p/12750018.html