In Java, we\'re using the following package to programmatically create excel documents:
org.apache.poi.hssf
If you attempt to set a sheet\'
This is what I use in C# (should be similar in Java):
const string invalidCharsRegex = @"[/\\*'?[\]:]+";
const int maxLength = 31;
string safeName = Regex.Replace(worksheetName, invalidCharsRegex, " ")
.Replace(" ", " ")
.Trim();
if (string.IsNullOrEmpty(safeName))
{
safeName = "Default"; // cannot be empty
}
else if (safeName.Length > maxLength)
{
safeName = safeName.Substring(0, maxLength);
}