XLSX

Error reading Excel .XLSX with Apache POI

荒凉一梦 提交于 2019-12-04 05:02:23
I am using Apache POI 3.8 libraries to read an XLSX file in a web application. The following code works perfectly fine from a Java console app: InputStream inputFS = new FileInputStream("test.xlsx"); Workbook workbook = new XSSFWorkbook(inputFS); // below exception is thrown on this line Sheet sheet = workbook.getSheetAt(0); but throws a "read error" when used in the web application. A relevant extract of the stack trace is pasted below: java.io.IOException: Read error at java.io.FileInputStream.readBytes(Native Method) ~[na:1.6.0_31] at java.io.FileInputStream.read(Unknown Source) ~[na:1.6.0

Serving Excel(xlsx) file to the user for download in Django(Python)

为君一笑 提交于 2019-12-04 04:54:20
I'm trying create and serve excel files using Django. I have a jar file which gets parameters and produces an excel file according to parameters and it works with no problem. But when i'm trying to get the produced file and serve it to the user for download the file comes out broken. It has 0kb size. This is the code piece I'm using for excel generation and serving. def generateExcel(request,id): if os.path.exists('./%s_Report.xlsx' % id): excel = open("%s_Report.xlsx" % id, "r") output = StringIO.StringIO(excel.read()) out_content = output.getvalue() output.close() response = HttpResponse(out

HTML table export to Excel (XLS or CSV)

寵の児 提交于 2019-12-04 04:37:31
问题 I'm trying to export HTML table content to excel. I saw this solution which worked but not as I expected it (because I can't choose which columns to copy , and it doesn't works with big tables ). And another solution to copy by js and manually paste to excel file, which didn't work as well, and I don't really fancy this method. Shortly what I want is, export customized view of the table, not all columns. to show you an example of what I mean: Here is the normal table view: and Here is how

Set Rows to repeat at top when printing - Open XML and Excel

不想你离开。 提交于 2019-12-04 04:19:18
问题 I am trying to get the first 4 rows of an xlsx file to repeat at the top of each page when printed. I am using the Open XML SDK to accomplish this. My file is being generated by the SSRS execution web service as a filestream. I then need to modify several layout and page settings (margins, page size, zoom, etc) before delivering the file to the user, as my users have very little Excel acumen. All other settings I need to tweak are working correctly, so I have stripped out all of that code

Use R and Openxlsx to output a list of dataframes as worksheets in a single Excel file

馋奶兔 提交于 2019-12-04 03:24:25
I have a set of CSV files. I want to package them up and export the data to a single Excel file that contains multiple worksheets. I read in the CSV files as a set of data frames. My problem is how to construct the command in openxlsx , I can do it manually, but I am having a list construction issue. Specifically how to add a data frame as a subcomponent of a named list and then pass as a parameter to write.xlsx() Example Ok, so I first list the CSV files on disk and generate a set of data frames in memory... # Generate a list of csv files on disk and shorten names... filePath <- "..

What's the difference between <c t=“str”> and <c><is> in Office Open XML?

喜你入骨 提交于 2019-12-04 03:11:29
问题 What's the difference between these two Office Open XML fragments? <c r="A2" t="str"> <v>btyler</v> </c> and <c r="B2"> <is><t>btyler</t></is> </c> note: The second sample I created manually based on the spec, the first is from an actual Excel workbook. Both seem valid and pretty much identical according to the spec, so I'm wondering why there is t="str" when <is> seemingly does the same thing. When does Excel choose to use one over the other? 回答1: According to the documentation at 18.18.11

How do I set the value of a specific cell using xlsx (R package)?

别等时光非礼了梦想. 提交于 2019-12-04 01:32:50
问题 I'm trying to set the value of a specific cell in xlsx. I'm doing this to add a title for the data frame that I added in Excel, but I can't figure it out. I tried createCells , createRows , getCells and getRows , but I can't seem to get any of them to work despite reading the documentation. 回答1: Without benefit of seeing your code and knowing exactly what you are trying to do, I suggest trying setCellValue(cell, value) For example, starting from scratch and creating a new excel file: wb <-

Converting .XLSX to .XLS in Python with win32com.client module

笑着哭i 提交于 2019-12-03 22:08:35
问题 I am trying to find a way to convert many files from .xlsx to .xls and have been trying Python with the win32com.client module: import win32com.client xl = win32com.client.Dispatch("Excel.Application") wb = xl.Workbooks.Open(r"C:\Users\Kathleen\Desktop\Exp 1_1\A 1-1-1c.xlsx") wb.SaveAs(r"C:\Users\Kathleen\Desktop\Exp 1_1\A 1-1-1c.xls", FileFormat = 56) wb.Close() xl.Quit() I have no error message but the converted file does not show up in the folder I have it set up for. Not sure what I am

Element 表格导出为Excel表格

◇◆丶佛笑我妖孽 提交于 2019-12-03 18:22:10
一、安装xlsx和filesaver npm install --save xlsx file-saver 二、在表格组件中引入安装的2个文件 import FileSaver from "file-saver"; import XLSX from "xlsx"; 三、HTML结构 <el-table :data="tableData3" style="width: 500px" height="250" id="table"> <el-table-column fixed prop="date" label="日期" width="150"></el-table-column> <el-table-column prop="name" label="姓名" width="120"></el-table-column> <el-table-column prop="province" label="省份" width="120"></el-table-column> <el-table-column prop="city" label="市区" width="120"></el-table-column> <el-table-column prop="address" label="地址" width="300"></el-table-column> <el-table

write.xlsx function not working

点点圈 提交于 2019-12-03 17:09:27
I am trying to use .xlsx library but function write.xlsx is returning error that such can not be found. When I am installing library(xlsx) in log I can read: Error : .onLoad nie powiodło się w funkcji 'loadNamespace()' dla pakietu 'rJava', szczegóły: wywołanie: fun(libname, pkgname) błąd: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. In addition: Warning messages: 1: pakiet ‘xlsx’ został zbudowany w wersji R 3.3.2 2: pakiet ‘rJava’ został zbudowany w wersji R 3.3.3 Error: pakiet ‘rJava’ nie mógł zostać