简体   繁体   English

如何使用java读取excel格式或损坏的excel文件

[英]How to read an not in excel format or corrupted excel file using java

I need to download some data in webpage in the form of excel file for that webpage contains excel image button. 我需要以excel文件的形式在网页中下载一些数据,因为该网页包含excel图像按钮。 When i click the button an excel file downloads with containing some data which i need. 当我点击按钮时,excel文件会下载并包含我需要的一些数据。 But when i tried to open the downloaded file it showing an error "The file you are trying to open , File is in different format then specified by the file extension or corrupted data. Because of this error i am unable to read the data by using java. 但是,当我试图打开下载的文件时,它显示错误“您尝试打开的文件,文件格式不同,然后由文件扩展名或损坏的数据指定。由于此错误,我无法通过使用来读取数据java的。

尝试将其保存为xlsx,因为poi提供了两种用于xls的工作簿,另一种用于xlsx。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM