-
2022-01-21 09:11:24
**
问题还原:
**
在做项目时,用户需要上传Excel模板,里面有对应的各种数据。我们拿到这个Excel后,定时的根据其中的数据去查对应的实时数据并进行计算,然后将实时数据和计算后的数据保存到Excel中存储到服务器上。用户在系统中可以看到Excel生成记录,点击后可以在线预览Excel。那么如何实现Excel在线预览那?
**解决方案:
方案1:
使用Office官方自带的url,大概就是把要预览的Excel地址拼装到Office的链接后边,就可以通过生成的新链接直接访问了。
PS:由于此方案会暴露数据,涉及隐私问题,所以此方法笔者没有尝试过,如有需要请自行百度。
方案2:
通过js- xlsx插件实现,具体代码如下:
Vue相关代码如下:
定义展示组件:<!-- Excel在线预览 --> <div class="excel-view-container"> <div id="excelView" v-html="excelView" ></div> </div>
安装js-xlsx插件:
npm install --save xlsx
JS代码如下:
import XLSX from 'xlsx' mounted () { Vue.axios({ method: 'get', url: '/后台url地址……', responseType: 'arraybuffer'// 注:此处需要设置哦,不然返回数据格式不对。 }).then((response) => { const workbook = XLSX.read(new Uint8Array(response), { type: 'array' }) // 解析数据 const worksheet = workbook.Sheets[workbook.SheetNames[0]] // workbook.SheetNames 下存的是该文件每个工作表名字,这里取出第一个工作表 this.excelView = XLSX.utils.sheet_to_html(worksheet) // 渲染 this.$nextTick(function () { // DOM加载完毕后执行,解决HTMLConnection有内容但是length为0问题。 this.setStyle4ExcelHtml() }) }).catch((error) => { this.$message.error(error) }) }, methods: { // 设置Excel转成HTML后的样式 setStyle4ExcelHtml () { const excelViewDOM = document.getElementById('excelView') if (excelViewDOM) { const excelViewTDNodes = excelViewDOM.getElementsByTagName('td')// 获取的是HTMLConnection if (excelViewTDNodes) { const excelViewTDArr = Array.prototype.slice.call(excelViewTDNodes) for (const i in excelViewTDArr) { const id = excelViewTDArr[i].id// 默认生成的id格式为sjs-A1、sjs-A2...... if (id) { const idNum = id.replace(/[^0-9]/ig, '')// 提取id中的数字,即行号 if (idNum && (idNum === '1' || idNum === 1)) { // 第一行标题行 excelViewTDArr[i].classList.add('class4Title') } if (idNum && (idNum === '2' || idNum === 2)) { // 第二行表头行 excelViewTDArr[i].classList.add('class4TableTh') } } } } } } }
Css样式代码如下:
<style scoped> /deep/ table { max-width: 100% !important; border-collapse: collapse !important; border-spacing: 0 !important; text-align: center !important; border: 0px !important; } /deep/ table tr td { /* border: 1px solid gray !important; */ border-right: 1px solid gray !important; border-bottom: 1px solid gray !important; } /**整体样式 */ /deep/ .excel-view-container { background-color: #FFFFFF; } /**标题样式 */ /deep/ .class4Title{ font-size: 22px !important; font-weight: bold !important; padding: 10px !important; } /**表格表头样式 */ /deep/ .class4TableTh{ /* font-size: 14px !important; */ font-weight: bold !important; padding: 2px !important; background-color: #EFE4B0 !important; } </style>
SpringBoot端相关代码如下:
Controller层代码:@GetMapping("/getExcelData") @ApiOperation(value = "获取Excel数据") public void getExcelData(HttpServletResponse response) throws IOException { ExcelUtil.readExcelToIO ("D:\\\\ExcelTest\\\\**.xlsx", response); } ExcelUtil代码如下: public static void readExcelToIO(String fileName, HttpServletResponse response) throws IOException { //判断是否为excel类型文件 if(!fileName.endsWith(".xls") && !fileName.endsWith(".xlsx")) { throw new RuntimeException("所传入文件不是Excel文件!"); } //读取Excel文件 File excelFile = new File(fileName.trim()); InputStream inputStream = new FileInputStream(excelFile); // 构造 XSSFWorkbook 对象,strPath 传入文件路径 Workbook workbook = null; //获取Excel工作薄 if (excelFile.getName().endsWith("xlsx")) { workbook = new XSSFWorkbook(inputStream); } else { workbook = new HSSFWorkbook(inputStream); } if (workbook == null) { throw new RuntimeException("Excel文件有问题,请检查!"); } // 读取第一个sheet页表格内容 Sheet sheet = workbook.getSheetAt(0); OutputStream os = response.getOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); workbook.write(baos); // 返回数据到输出流对象中 os.write(baos.toByteArray()); os.flush(); os.close(); }
PS:欢迎大家点赞、关注、支持。如有需要,欢迎添加博主QQ沟通交流!QQ:156587607
更多相关内容 -
POI实现word和excel在线预览
2018-02-11 09:40:19里面有工具类,包含word和excel。支持doc。docx xls和xlsx等格式。还有稀缺的所有jar包。绝对物有所值 -
poi实现word、excel在线预览
2017-09-13 11:40:46java实现word、excel在线预览。版本2003和2007都支持在线预览,项目需要导入一些poi相关的jar,jar之间的版本有要求。在我的资源列表,有相关的jar包可以下载。 -
在线文档预览,支持ppt,word,excel在线预览
2017-09-25 15:04:29使用OpenOffice + jodconverter 将文档转成pdf,通过pdf.js在页面展示 写的是Stringboot 版的demo,核心代码很少,很容易懂 -
在线预览excel
2018-04-04 17:16:47kkFileView 是个以 spring boot 构建的文件在线预览的项目,以最宽松的Apache协议开源。 -
web项目移动端在线预览(excel在线预览)
2020-05-04 20:34:56本项目excel在线预览利用OpenOffice实现 1. 后台实现(前台调用在前面的word转html中) if(fileVO.getFileName().indexOf(".xls") > -1||fileVO.getFileName().indexOf(".xlsx") > -1 ||fileVO.getFileName...本项目excel在线预览利用OpenOffice实现
1. 后台实现(前台调用在前面的word转html中)
if(fileVO.getFileName().indexOf(".xls") > -1||fileVO.getFileName().indexOf(".xlsx") > -1 ||fileVO.getFileName().indexOf(".ppt") > -1||fileVO.getFileName().indexOf(".pptx") > -1) { URL url = new URL(Global.imgServer + "?file=" + fileVO.getFilePath() + "&name=" + URLEncoder.encode(fileVO.getFileName(), "utf-8")); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); //保存pdf之前,先调用解密方法 DataInputStream input = new DataInputStream(conn.getInputStream()); String filename = fileVO.getFileName(); Boolean flag = request.getHeader("User-Agent").indexOf("like Gecko") > 0; if (request.getHeader("User-Agent").toLowerCase().indexOf("msie") > 0 || flag) { filename = URLEncoder.encode(filename, "UTF-8");// IE浏览器 } else { // 先去掉文件名称中的空格,然后转换编码格式为utf-8,保证不出现乱码, // 这个文件名称用于浏览器的下载框中自动显示的文件名 filename = new String(filename.replaceAll(" ", "").getBytes("UTF-8"), "ISO8859-1"); } filename=filename.replaceAll("\\+","%20"); byte[] buffer = new byte[1024]; BufferedInputStream bis = null; File file=new File(LawConfig.officeHtml+fileVO.getFileName()); FileOutputStream out=new FileOutputStream(file,true); try { bis = new BufferedInputStream(input); int i = bis.read(buffer); while (i != -1) { out.write(buffer, 0, i); i = bis.read(buffer); } } catch (Exception e) { e.printStackTrace(); } finally { if (bis != null) { try { bis.close(); } catch (IOException e) { e.printStackTrace(); } } if (input != null) { try { input.close(); } catch (IOException e) { e.printStackTrace(); } } out.close(); } System.setProperty("user.dir", "解密接口地址"); InteKey mInteKey = new InteKey(); System.out.println("开始验证,文件是:"+LawConfig.officeHtml + fileVO.getFileName()); int ia = mInteKey.Ia(LawConfig.officeHtml + fileVO.getFileName()); System.out.println("验证结果:" + ia); if (ia == 0) { // 加密文件,需要做解密处理 System.out.println("开始解密"); int da = mInteKey.Da(LawConfig.officeHtml + fileVO.getFileName(), LawConfig.officeHtml + fileVO.getFileName()); System.out.println("解密结果:" + da); } InputStream is = new FileInputStream(LawConfig.officeHtml + fileVO.getFileName()); //项目路径 String path = request.getSession().getServletContext().getRealPath("/").replaceAll("\\\\", "/"); String targetPath = path + "/page/mobile_html/"; //类型 String type = fileVO.getFileName().substring(fileVO.getFileName().lastIndexOf(".")+1); //文件名 String fileName = fileVO.getFilePath().substring(0, fileVO.getFilePath().lastIndexOf(".")); //这里将方法写到了工具类中 String returnPath = file2HtmlUtil.file2Html(is,LawConfig.officeHtml,targetPath,type,fileName); FileInputStream fis = null; OutputStream os = null; fis = new FileInputStream(targetPath+returnPath); os = response.getOutputStream(); int count = 0; while ((count = fis.read(buffer)) != -1) { os.write(buffer, 0, count); os.flush(); } fis.close(); os.close();
工具类
package com.daorigin.law.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.ConnectException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.MissingResourceException; import java.util.ResourceBundle; import com.artofsolving.jodconverter.DocumentConverter; import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection; import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection; import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter; public class file2HtmlUtil { public static String file2Html(InputStream fromFileInputStream, String sourcePath, String targetPath, String type, String fileName) throws IOException { System.out.println("----------------------------------------------sourcePath:"+sourcePath); System.out.println("----------------------------------------------targetPath:"+targetPath); System.out.println("----------------------------------------------fileName:"+fileName); String docFileName = null; String htmFileName = null; if("xls".equals(type)){ docFileName = fileName + ".xls"; htmFileName = fileName + ".html"; }else if("xlsx".equals(type)){ docFileName = fileName + ".xlsx"; htmFileName = fileName + ".html"; }else if("ppt".equals(type)){ docFileName = fileName + ".ppt"; htmFileName = fileName + ".html"; }else if("pptx".equals(type)){ docFileName = fileName + ".pptx"; htmFileName = fileName + ".html"; }else if("txt".equals(type)){ docFileName = fileName + ".odt"; htmFileName = fileName + ".html"; }else{ return null; } File htmlOutputFile = new File( targetPath + File.separatorChar + htmFileName); System.out.println("++++++++++++++++++++++++++++++html路径:"+htmlOutputFile); File docInputFile = new File(sourcePath + File.separatorChar + docFileName); System.out.println("++++++++++++++++++++++++++++++doc路径:"+docInputFile); if (htmlOutputFile.exists()) htmlOutputFile.delete(); File parentOut = htmlOutputFile.getParentFile(); // 获取父文件 if( !parentOut.exists() ) parentOut.mkdirs(); //创建所有父文件夹 htmlOutputFile.createNewFile(); if (docInputFile.exists()) docInputFile.delete(); File parentIn = docInputFile.getParentFile(); // 获取父文件 if( !parentIn.exists() ) parentIn.mkdirs(); //创建所有父文件夹 docInputFile.createNewFile(); /** * 由fromFileInputStream构建输入文件 */ try { OutputStream os = new FileOutputStream(docInputFile); int bytesRead = 0; byte[] buffer = new byte[1024 * 8]; while ((bytesRead = fromFileInputStream.read(buffer)) != -1) { os.write(buffer, 0, bytesRead); os.close(); fromFileInputStream.close(); } catch (IOException e) { } //OpenOffice默认端口是8100 OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100); try { connection.connect(); } catch (ConnectException e) { System.err.println("文件转换出错,请检查OpenOffice服务是否启动。"); } // convert DocumentConverter converter = new OpenOfficeDocumentConverter(connection,new DefaultDocumentFormatRegistry()); converter.convert(docInputFile, htmlOutputFile); connection.disconnect(); // 转换完之后删除word文件 docInputFile.delete(); return htmFileName; } }
我在做excel转换的时候xls没有问题,xlsx转换失败,后来发现是默认定义的excel中没有xlsx格式,这里自己通过集成对应类的方式自定义了xlsx格式
package com.daorigin.law.util; import com.artofsolving.jodconverter.DocumentFamily; import com.artofsolving.jodconverter.DocumentFormat; public class DefaultDocumentFormatRegistry extends com.artofsolving.jodconverter.DefaultDocumentFormatRegistry { public DefaultDocumentFormatRegistry() { super(); //这个是自己加的 final DocumentFormat xls = new DocumentFormat("Microsoft Excel", DocumentFamily.SPREADSHEET, "application/vnd.ms-excel", "xlsx"); xls.setExportFilter(DocumentFamily.SPREADSHEET, "MS Excel 97"); addDocumentFormat(xls); } }
-
使用java实现 Excel在线预览
2021-04-30 10:50:32当前有个需求,需要实时读取excel的内容,并显示在页面上。 收到需求的时候, java后端能不能生成个临时文件,然后展示到前台页面,前台只要能请求到后端,预览就生效了。 2 Do IT 2.1 引入pom文件 <...1 背景
当前有个需求,需要实时读取excel的内容,并显示在页面上。
收到需求的时候, java后端能不能生成个临时文件,然后展示到前台页面,前台只要能请求到后端,预览就生效了。
2 Do IT
2.1 引入pom文件
<dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.9</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.10.3</version> </dependency>
2.2 直接上代码
@GetMapping(value = "/showexcel") public void showexcel(HttpServletResponse response) throws Exception { String path = "C:\\Users\\Administrator\\Desktop\\临时\\"; String file = "2021-03-11_2021年3月11日差异报表.xls"; InputStream input = new FileInputStream(path + file); HSSFWorkbook excelBook = new HSSFWorkbook(input); ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument()); excelToHtmlConverter.processWorkbook(excelBook); List pics = excelBook.getAllPictures(); if (pics != null) { for (int i = 0; i < pics.size(); i++) { Picture pic = (Picture) pics.get(i); try { pic.writeImageContent(new FileOutputStream(path + pic.suggestFullFileName())); } catch (FileNotFoundException e) { e.printStackTrace(); } } } Document htmlDocument = excelToHtmlConverter.getDocument(); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); DOMSource domSource = new DOMSource(htmlDocument); StreamResult streamResult = new StreamResult(outStream); TransformerFactory tf = TransformerFactory.newInstance(); Transformer serializer = tf.newTransformer(); serializer.setOutputProperty(OutputKeys.ENCODING, "utf-8"); serializer.setOutputProperty(OutputKeys.INDENT, "yes"); serializer.setOutputProperty(OutputKeys.METHOD, "html"); serializer.transform(domSource, streamResult); outStream.close(); String content = new String(outStream.toByteArray()); String fileName =path + "exportExcel.html"; FileUtils.writeStringToFile(new File(fileName), content, "utf-8"); InputStream inputStream = new FileInputStream(fileName); FileInputStream fileIs = null; try { fileIs = (FileInputStream) inputStream; } catch (Exception e) { return; } //得到文件大小 byte data[] = new byte[fileIs.available()]; //读数据 int count = 0; fileIs.read(data); //设置返回的文件类型 response.setContentType("image.png"); //得到向客户端输出二进制数据的对象 OutputStream outStreams = response.getOutputStream(); //输出数据 outStreams.write(data); outStreams.flush(); outStreams.close(); fileIs.close(); }
3 查看效果
4 相关参考
部分代码参考了如下博客,虽然他们只讲了一半,实操不行,但是还是有可取之处。
java实现在线预览--poi实现word、excel、ppt转html
-
网页实现Excel在线预览方案集合
2020-12-31 08:54:18在WEB项目中经常遇到excel文档在线预览的需求,基本的解决思路有以下几大类:excel文档转PDF、excel文档直接转html、后台读取excel数据返回给前端利用Excel效果的表格插件如(HandsonTable)将数据进行展示、部署微软...在WEB项目中经常遇到excel文档在线预览的需求,基本的解决思路有以下几大类:excel文档转PDF、excel文档直接转html、后台读取excel数据返回给前端利用Excel效果的表格插件如(HandsonTable)将数据进行展示、部署微软Office Online服务(office web apps)实现在线预览、在线的office预览服务(如谷歌docs、微软officeapps)。
excel表格
EXCEL转PDF
excel转pdf可以通过第三方工具openoffice或者第三方类库如POI/NPOI、aspose等转换为pdf文件,然后通过pdf.js将转换完的pdf文件渲染成Canvas加载在网页上的显示。pdf.js显示pdf文件步骤:首先在页面引入pdf.js,然后PDFJS.getDocument('helloworld.pdf'),然后在回调函数里面设置显示的容器高度宽度等信息,另外pdf.js还支持翻页等功能。
EXCEL转HTML
excel转html可以通过第三方工具openoffice、微软office或者第三方类库如POI/NPOI、aspose.cell等转换为html文件。其中POI组件是开源免费的,Java版本叫POI,C#版本叫NPOI。但是转换的效果不是很好,有多个sheet页面的时候,POI会将所有sheet表格展示在一个网页里面,表格顶部会显示sheet名称,如果sheet很多的话页面会很长,出现滚动条页面样式不是很美观。
aspose.cell是收费组件,支持java、.net、.net core,免费使用时候转换出的html页面会有水印“Evaluation Only. Created with Aspose.Cells”如果excel存在多个sheet,aspose转换出来的网页会带选项卡,点击选项卡会展示对应的sheet页面内容,展示效果比POI转换出的html效果的好。 aspose-cells maven pom配置如下:
com.aspose
aspose-cells
8.2.1
本地部署微软Office Online Server
本地部署office online功能,需要的是2台服务器,并且服务需要安装windwos Server系统,配置比较复杂,首先安装IIS创建域,然后导入OfficeWebApps模块、创建Office Online Server、验证Office Online Server、下载并部署Wopi项目。整个配置部署完毕后便可以在线预览编辑office文档了,展示效果比转换成pdf/html的效果好太多。
在线的office预览服务
谷歌、微软都提供在线office的预览服务,微软的预览服务地址后面加参数?src=文档的URL地址,谷歌的文档服务预览地址加参数?url=文档的URL地址,URL的参数是需要预览的文件URL,这样预览效果还不错方便快捷。效果和上面的方案本地部署微软office on line服务差不多,不同的是一个是在线的,一个是本地化服务,各有利弊。
前端Excel效果的表格插件
前端JavaScript的Excel效果的表格插件,如HandsonTable,需要后台返回excel数据然后通过JS填空到表格,如果Excel包含很多合并单元格以及多个sheet页面,这样是很不方便的,效率也比不上前几种。
-
vue移动端实现excel在线预览
2020-12-28 15:55:10上篇博客我提到了ios手机不能实现下载功能,但是可以实现预览,图片预览和pdf预览我已经在前篇博客做了讲解,但是,在工作中大家上传最多的应该是excel的文件,今天我就讲解一下excel移动端的预览实现。 预览excel... -
pdf excel 在线预览
2015-12-14 17:29:00pdf excel 在线预览. -
前端-Excel在线预览
2019-07-04 02:10:28前端-Excel在线预览 最近项目中有一个 Excel 预览的需求,就调研了一下 xls/xlsx、word、ppt 文件在线预览功能的实现 。 实现 xls/xlsx、word、ppt 在线预览功能最简单的实现方式就是调用微软 联机查看 或或者谷歌... -
java web在线预览pdf、word、excel
2017-11-15 16:53:55使用maven构建工具。前端使用pdf插件。后台搭建的springmvc框架,主要用于web在线预览pdf、word、excel文件。不需要安装office等其他插件 -
Python excel转成html页面 excel 在线预览
2020-01-09 18:54:31Python excel转成html页面 excel 在线预览 因为这两天公司的项目要用到在浏览excel 所以就在做这个功能。一开始查了很多资料 都是各种不行,最后好不容易找到一些辅助资料 终于是今天把它修改完成了,用的是dominate... -
Office在线预览,PPT在线预览,word在线预览,Excel在线预览,PDF在线预览
2021-08-24 10:43:16如果实现Office文件在线预览 http://usdoc.61office.com/ex.html usdoc文档在线预览服务 特点:支持PC端office预览,支持移动端office在线预览,支持IOS,Mac等平板设备在线预览。 一、使用方法 拼接文件地址。 将... -
word在线预览api接口 office在线预览接口 word转图片 ppt在线预览 excel在线预览
2019-05-14 20:52:21word在线预览api接口 office在线预览接口 word转图片 ppt在线预览 excel在线预览 预览支持的文件格式:word(doc,docx),excel(xls,xlsx),ppt(ppt,pptx),pdf 生成预览原理:文件转成图片 支持移动端浏览,... -
使用spreadjs实现纯前端的Excel在线预览
2020-12-02 10:20:08近期项目需要实现Excel表格预览功能,找了很多资料,有的需要后台配合完成,有的纯前端可以实现,但是效果不是很好,然后发现这个做完效果还行 1,先将spreadjs下载,引入项目中,或者直接使用cdn引入 <script ... -
java实现在线预览--poi实现word、excel、ppt转html
2019-07-31 18:39:43java实现在线预览- -之poi实现word、excel、ppt转html -
aspose -ppt/word/excel 在线预览ppt、word、excel文件
2017-09-26 15:54:10在线预览ppt、word、excel功能。通过url在本地生成html/pdf文件,然后实现在线预览功能。这是一个完成的springmvc的maven项目。下载即可运行。asposejar已包含在项目里面。 -
aspose实现word,excel在线预览
2021-05-18 10:05:28aspose实现word,excel在线预览 一,项目中引入aspose依赖 <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-words</artifactId> <version>15.8.0</... -
jsp开发实现wordexcel的在线预览
2018-10-03 10:01:34jsp开发实现word、excel的在线预览功能,实用性强。欢迎下载 -
Word、Excel、PPT、PDF在线预览解决方案.zip
2021-10-09 13:08:52Word、Excel、PPT、PDF在线预览解决方案 -
❤️强烈推荐!Word、Excel、PPT、PDF在线预览解决方案
2021-10-09 13:23:55平时大伙开发项目的时候,经常遇到业务需求Word、Excel、PPT、PDF在线预览功能; 市面上这方面的解决方案也有一些,不做过多评价。今天主要推荐的是一个特定提前下的永久免费解决方案; 调用微软的在线预览功能... -
excel使用java在线预览
2021-02-12 15:01:04} catch (Exception arg17) { log.error("读取Excel文件发生异常!", arg17); } if (!((InputStream) input).markSupported()) { input = new PushbackInputStream((InputStream) input, 8); } try { if (!... -
js-xlsx vue导入excel在线预览
2021-03-15 11:36:20js-xlsx vue导入excel在线预览 导入XLSX库 官方地址Github 安装 npm install xlsx --s 引入 import XLSX from ‘xlsx’ HTML <template> <div class="upload-container"> <el-upload ref="upload... -
vue excel上传预览和table内容下载到excel文件中
2020-10-15 21:29:02主要介绍了vue excel上传预览和table内容下载到excel文件中,本文通过实例代码给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下 -
vue+element-ui调用后台接口实现excel在线预览
2020-08-18 17:29:22aaa -
直接在线预览Word、Excel、TXT文件之ASP.NET
2020-09-03 11:26:59主要用asp.net技术实现直接在线预览word、excel、txt文件,有需要的朋友可以参考下 -
vue在线预览excel
2021-05-28 15:41:27最便捷的预览方式可以使用 微软提供的方法: window.open( “https://view.officeapps.live.com/op/view.aspx?src=” + this.yuming + “/zhengCe?id=” + row.id, “_blank”);