Comments (2)
Hello,
I have found the problem with the changed example. I forgot to change the ctTable.id
to i
.
Now the example works.
In my code the id was set correctly.
After further testing I identified my values for table.name
as the problem.
Some started with _ some with numbers.
I already wrote a function for the sheet names because of its maxLength.
private static string SanitizeAndTruncateStart(string? toBeChanged, int maxLength = 31)
{
if (string.IsNullOrEmpty(toBeChanged)) return string.Empty;
var sanitizedMemberName = new string(toBeChanged.Where(char.IsLetter).ToArray());
return TruncateStart(sanitizedMemberName, maxLength);
}
private static string TruncateStart(string? toBeChanged, int maxLength = 31)
{
if (string.IsNullOrEmpty(toBeChanged)) return string.Empty;
return toBeChanged.Length > maxLength ? toBeChanged[^maxLength..] : toBeChanged;
}
Does anyone know the exact rules for table.Name
?
I think if the question is answered, the issue can be closed.
Best regards,
Peter
from npoi-examples.
name (Name)
A string representing the name of the table that is used to reference the table programmatically through the spreadsheet applications object model. This string shall be unique per table per sheet. It has the same length and character restrictions as for displayName.By default this should be the same as the table's displayName. This name should also be kept in synch with the displayName when the displayName is updated in the UI by the spreadsheet user.The possible values for this attribute are defined by the ST_Xstring simple type (§22.9.2.19).
from npoi-examples.
Related Issues (20)
- I can't change the CellType to "Currency" HOT 2
- mistake in calendar example
- . HOT 1
- How to set picture layout type in XWPF? HOT 5
- Unable to Open Excel XLS with hyperlink cells. HOT 1
- How to read unformatted cell value HOT 1
- How to Protect a xlsx file with Password? HOT 1
- Make Examples Output UTF-8 HOT 1
- How to Remove Row without issues? HOT 1
- Hi ~ I need to use npoi to create a line chart in Excel. Which example should I refer to? HOT 2
- Provide a way to add bodyElement in XWPFDocument HOT 5
- Adding table and pictures with string replacement.
- Invalid decimal format in xl\charts\chart1.xml working with Italian Culture HOT 1
- XWPF SetText() examples misleading HOT 3
- ScatterChart
- GetEnumerator() method is missing HOT 1
- Can't rotate picture in Word file
- How to change the orientation of a certain page regarding docx HOT 1
- To set Different Colors For each column in column chart
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 npoi-examples.