davidpelfree / sjxlsx Goto Github PK
View Code? Open in Web Editor NEWJava API to read and write XLSX Excel files, as a whole or using a streaming API.
Java API to read and write XLSX Excel files, as a whole or using a streaming API.
I'm trying to use this library in order to generate an execel file on the fly. The end goal is not to generate an excel file on disk but rather generate it from a database and push it to an outputstream. Thus this doesn't make any sense to me:
File file = ..
SimpleXLSXWorkbook workbook = new SimpleXLSXWorkbook(file);
Why do I need the file? I've tried to just generate an empty file like this:
File file = Files.createTempFile(UUIDUtil.newUUID(), "xlsx").toFile();
SimpleXLSXWorkbook workbook = new SimpleXLSXWorkbook(file);
but this throws:
java.lang.RuntimeException: java.util.zip.ZipException: zip file is empty
Do you require an existing valid excel file for this to work?
In POI, we can getName() from workbook, is it possible in sjxlsx?
if not, can you give some suggestion how implement this function.
Hello,
Please show an example how to create a hyperlink to some web page http://www.somesite.com
Thank you
Excel has 2000 columns, but the API is reading only first 52 columns ?
How to fix this
When you get some value of the some cell, and this cell is a merge/combine cell, just the first row get data, the other rows, get null/empty value.
Is there a way to read hidden column and rows ?
Now there is no way using public API of SimpleXLSXWorkbook to get sheet name.
I'm using this library to modify an existing workbook. After writing any data to any sheet, all comments in the workbook are removed, along with all formatting on any worksheet that we have written to. This includes, but may not be limited to, column/row sizes, and cell text/background color.
After opening this workbook Excel gives a notification saying "We found a problem with some content in $filename. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."
When I try to getValue() from a date cell, the returned value is an integer.
How can I obtain the date value from a date cell ?
As in how do I import the code here. Do I need to make a library with what's here or something else? I'm trying to make a library with all this but getting lots of errors.
When you need get data in other sheet different 0 you can't get because you can't pass index sheet
Hi ,
I'm so impress by the speed. But too bad it failed read Google drive exported xlsx file .
Thanks for the Great library
I have the issue when calling workbook.commit() when trying to save the file. It says there is an encoding error, but only after writing individual characters to the second sheet of the workbook.
You can find the source on our github below, line 40 can be commented out and it runs fine.
Heres the stack trace too:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: javax.xml.stream.XMLStreamException: Underlying stream encoding 'Cp1252' and input paramter for writeStartDocument() method 'UTF-8' do not match.
at com.incesoft.tools.excel.xlsx.SimpleXLSXWorkbook$Commiter.endCommit(SimpleXLSXWorkbook.java:947)
at com.incesoft.tools.excel.xlsx.SimpleXLSXWorkbook.commit(SimpleXLSXWorkbook.java:1089)
at dataorganizer.SpreadSheetController.save(SpreadSheetController.java:71)
at dataorganizer.SpreadSheetController.main(SpreadSheetController.java:41)
Caused by: java.lang.RuntimeException: javax.xml.stream.XMLStreamException: Underlying stream encoding 'Cp1252' and input paramter for writeStartDocument() method 'UTF-8' do not match.
at com.incesoft.tools.excel.xlsx.SimpleXLSXWorkbook$Commiter.mergeSheets(SimpleXLSXWorkbook.java:980)
at com.incesoft.tools.excel.xlsx.SimpleXLSXWorkbook$Commiter.endCommit(SimpleXLSXWorkbook.java:939)
... 3 more
Caused by: javax.xml.stream.XMLStreamException: Underlying stream encoding 'Cp1252' and input paramter for writeStartDocument() method 'UTF-8' do not match.
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartDocument(Unknown Source)
at com.incesoft.tools.excel.xlsx.SheetCommentWriter.writeStart(SheetCommentWriter.java:49)
at com.incesoft.tools.excel.xlsx.SheetCommentWriter.writeComment(SheetCommentWriter.java:128)
at com.incesoft.tools.excel.xlsx.Sheet$SheetWriter.writeCell(Sheet.java:604)
at com.incesoft.tools.excel.xlsx.Sheet$SheetWriter.writeRow(Sheet.java:581)
at com.incesoft.tools.excel.xlsx.Sheet.mergeSheet(Sheet.java:665)
at com.incesoft.tools.excel.xlsx.SimpleXLSXWorkbook$Commiter.mergeSheets(SimpleXLSXWorkbook.java:975)
... 4 more
First of all i would like to thank you for this code base provided for huge excel writing in java.
I want to write a cell with number(integer,float,double)value as ,while we are writing the number into string in the excel it is showing some warnings.
I think in xml writer class or sharedstringtext class should be modified for this.
Kindly give me the solution for this problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.