Comments (8)
Thanks for your feedback, I think I have fixed this issue, but the release date is not guaranteed
from fastexcel.
A temporary solution is to escape special characters beforehand.
...
worksheet.range(0, 0, row - 1, getDataRow1().size() - 1).createTable(escape(toArray(getHeadersCorrupt())))
.styleInfo().setStyleName("TableStyleMedium3");
...
...
private String[] escape(String[] stringArray) {
for (int i = 0; i < stringArray.length; i++) {
stringArray[i] = XmlEscapeHelper.escape(stringArray[i]);
}
return stringArray;
}
...
from fastexcel.
Hi Tom,
thanks for your investigation and reply.
Unfortunately, your suggested solution doesn't work. I had already tried to replace the ampersand with the escaped characters &. If I do this, the error message still comes up when the excel file is opened, and the header doesn't show the ampersand, but the escaped sequence.
Also, using your escape method (which seems to do the same for the ampersand), doesn't help. (I had to modify your solution slightly to "new XmlEscapeHelper().escape(.)", as the method is not static.
Best,
Holger
from fastexcel.
I'm not sure if you've applied the correct escapes because I can't see your code. In my test, the &
is translated to &
,and stored in the table1.xml file. You can change the suffix of the generated xlsx file to zip, then unzip it and check the xl/tables/table1.xml file. Check the name property on table>tableColumns>tableColumn to see if the &
is correctly escaped.
from fastexcel.
Yes, the &
is translated to &
, and I can see it in the table1.xml file (I always investigate it with 7zip). But that doesn't make the error disappear.
Have you tried your solution with my sample project I created?
from fastexcel.
I just checked the code, and in the latest released version 0.18.0, the XmlEscapeHelper().escape(.) method is indeed not static. I have submitted the code to make changes to this a few months ago. This change is already in the latest code of the master branch, but when it will be released depends on the project owner.
from fastexcel.
Related Issues (20)
- Writing files using predefined dataformat strings
- Comments vs Notes HOT 2
- Ability to get rich Text formatting on cell value HOT 1
- Corrupt Excel file generated HOT 2
- Why is fastexcel not modularized (Java 9 module system) yet? HOT 5
- getCellAsNumber as is misleading
- xlsx with new Lines (CR+LF) : Parsing error HOT 5
- Security vulnerability in 0.17.0 HOT 3
- Adding information about the author of the comment. HOT 2
- Test case 'CorrectnessTest#testForAllFeatures' is broken HOT 1
- Create a new module 'fastexcel-base'/'fastexcel-common' HOT 1
- does fastexcel works in android?
- Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory
- How can I read existing style from existing row?
- how to add a cell to a row when using the the reader HOT 1
- Proposal: add a note that this library is GraalVM-friednly
- Preserve spaces
- Worksheet Writer does not allow setting correct dimension ref value
- Validation data with formula to produce a list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastexcel.