Modify

Opened 2 years ago

Last modified 2 years ago

#10623 new enhancement

[patch] use excel cell type standard for cols with long text content, character replacement

Reported by: jholg Owned by: jun66j5
Priority: normal Component: ExcelDownloadPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

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.

Holger

Attachments (1)

exceldownload_longtext_patch.diff (4.1 KB) - added by jholg 2 years ago.
Patch to provide configurable handling of long text cols & text replacement

Download all attachments as: .zip

Change History (2)

Changed 2 years ago by jholg

Patch to provide configurable handling of long text cols & text replacement

comment:1 in reply to: ↑ description Changed 2 years ago by jholg

Replying to jholg:

Find patch attached.

Based on r12346 of ExcelDownloadPlugin, that is.

Holger

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.