[patch] use excel cell type standard for cols with long text content, character replacement
|Reported by:||jholg||Owned by:||jun66j5|
Hi, great plugin!
For my use case I noticed that often the resulting spreadsheets display "hash marks" for cells containing lots of text, which ticket descriptions and comments regularly do.
This is due to some Excel "feature", see http://excelribbon.tips.net/T008444_Hash_Marks_Displayed_Instead_of_Cell_Contents.html for explanations.
Therefore I added the possibility to configure columns as "long text columns" which will then get the Excel cell type "Standard" instead of "Text" which doesn't suffer from this particular problem. Per default, columns 'description' and 'comment' are qualified as "long text columns".
Additionally I encountered some problems with characters in ticket descriptions that aren't displayed nicely in the spreadsheets, e.g. Tab characters and stuff, probably put into ticket comments and descriptions by cut-and-paste. To handle this I added a possibility to specify simple text replacement rules to remove or change such characters, by using re.sub(...). Per default, no replacement is done.
Looks like this in trac.ini:
[exceldownload] # Example: switch off long-text-column treatment # (default is long_text_columns = description,comment) #long_text_columns = # replace tabs and carriage return characters with 4 blanks '=>' is the split # character to split match expression and replacement string in the rules replace_text = (\t|\r)=>" " # Example: if you can't use the default split character(s) '=>' due to # your regexp or replacement string you can configure a different split text: #replace_text = (\t=>|\r):" " #replace_text_split_char = :
Find patch attached.