Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
repanier
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
repanier
Commits
d69d10c1
Commit
d69d10c1
authored
Dec 08, 2016
by
Patrick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slugify the worksheet name to avoid invalid characters
parent
f5880825
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
repanier/xlsx/export_tools.py
repanier/xlsx/export_tools.py
+3
-2
No files found.
repanier/xlsx/export_tools.py
View file @
d69d10c1
...
...
@@ -2,6 +2,7 @@
from
__future__
import
unicode_literals
from
django.contrib.sites.models
import
Site
from
django.utils.text
import
slugify
from
django.utils.translation
import
ugettext_lazy
as
_
from
openpyxl.cell
import
get_column_letter
from
openpyxl.style
import
NumberFormat
...
...
@@ -15,8 +16,8 @@ from repanier.tools import cap
def
worksheet_setup_a4
(
worksheet
,
title1
,
title2
,
add_print_title
=
True
):
title1
=
"%s"
%
(
title1
)
worksheet
.
title
=
cap
(
title1
,
31
)
title1
=
"%s"
%
title1
worksheet
.
title
=
cap
(
slugify
(
title1
)
,
31
)
worksheet
.
page_setup
.
paperSize
=
worksheet
.
PAPERSIZE_A4
worksheet
.
page_setup
.
fitToPage
=
True
worksheet
.
page_setup
.
fitToHeight
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment