Add xlsxwriter-based Excel generation scripts with openpyxl implementation

- Created create_excel_xlsxwriter.py and update_excel_xlsxwriter.py
- Uses openpyxl exclusively to preserve Excel formatting and formulas
- Updated server.js to use new xlsxwriter scripts for form submissions
- Maintains all original functionality while ensuring proper Excel file handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
andrei
2025-09-22 13:53:06 +00:00
commit 0e2e1bddba
842 changed files with 316330 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
# Copyright (c) 2010-2024 openpyxl
"""
OOXML has non-standard escaping for characters < \031
"""
import re
def escape(value):
r"""
Convert ASCII < 31 to OOXML: \n == _x + hex(ord(\n)) + _
"""
CHAR_REGEX = re.compile(r"[\001-\031]")
def _sub(match):
"""
Callback to escape chars
"""
return "_x{:0>4x}_".format(ord(match.group(0)))
return CHAR_REGEX.sub(_sub, value)
def unescape(value):
r"""
Convert escaped strings to ASCIII: _x000a_ == \n
"""
ESCAPED_REGEX = re.compile("_x([0-9A-Fa-f]{4})_")
def _sub(match):
"""
Callback to unescape chars
"""
return chr(int(match.group(1), 16))
if "_x" in value:
value = ESCAPED_REGEX.sub(_sub, value)
return value