docs/Features/ImportExport/Excel/Excel.md
WeKan exports either a whole board or one card as an .xlsx workbook. The
board export has two forms:
The related PDF export uses the same field selection and the same card-document model. The intended common layout is described in One Card Layout.
models/exportExcel.js and models/server/ExporterExcel.js implement the
streaming board table.models/exportExcelCard.js and
models/server/ExporterExcelCard.js implement a printable card workbook.models/server/ExporterExcelBoard.js reuses the card renderer for every card
when detailed board export is selected.models/server/renderCardDocumentExcel.js renders every block from the shared
card document with the six-column worksheet geometry.models/lib/cardExportDocument.js is the single adapter from board, card,
people, checklist, comment and attachment records to that card document. PDF
calls the same adapter, including for human-readable attachment sizes.models/server/createWorkbook.js selects the safe buffered ExcelJS writer
when the installed streaming writer cannot load.models/lib/cardDocument.js is the medium-independent card layout shared
with PDF.The board, swimlane, list and card hamburger menus all include the same
exportScopeBody Blaze template from
client/components/boards/exportScope.jade. Its format table, section
checkboxes, URL builder, locale parameters and scope parameters are defined
once in client/components/boards/exportScope.js. There are no separate Excel
or PDF menu templates for the four scopes.
On the server, scope changes only the surrounding hierarchy and the cards
selected. Every selected card goes through buildExportCardDocument; detailed
board, list and swimlane Excel then calls the same
ExporterExcelCard.renderCardBlock used by a single-card export. Excel-specific
code only converts the shared blocks into worksheet cells, fills, borders,
progress bars and images.
ExcelJS writes rich text for Markdown, embeds JPEG, PNG, GIF and BMP attachment previews, formats dates in the requesting browser's timezone, and prints only the sections selected in the export dialog. The workbook is generated directly into the HTTP response and does not use a temporary export file.
Detailed exports follow the visible hierarchy. A board workbook starts with the board name, members, creation time and modification time, then writes each swimlane, each list in that swimlane, and each card in that list. A swimlane export starts with that swimlane and continues with its lists and cards; a list export starts with that list and its cards; a card export contains that card. Even a board with one visible swimlane names it explicitly. PDF uses this same ordering.
The shared card block includes the complete opened-card data: labels, stickers, all locations (place name, address, latitude and longitude), people, board/list/ swimlane information, numeric sort position, dates and time tracking, dependencies, description, custom fields, checklists, subtasks, comments, attachments, voting and planning poker. Legacy single-location fields are rendered the same way as the current multiple-location array.
The attachment section lists every file in a six-column details table: row number, filename, human-readable size, media type, upload date/time and uploader. Preview images use one worksheet column each, up to six on the same row, with the filename in the cell directly below each image. The seventh image starts the next image row, followed by its own filename row.
Excel stores text as Unicode, so the export preserves every language. The
.xlsx format used by ExcelJS cannot portably embed an OpenType font: it records
a font family name and the spreadsheet application selects an installed font or
fallback. Bundling GNU Unifont therefore fixes portable PDF rendering but cannot
force the same font into an Excel workbook. Converting cells to pictures would
make all glyphs visible but would destroy editing, searching, copying and
accessibility, so WeKan keeps real Unicode cell text.
Completed:
There is no remaining export-layout implementation item. Portable font
embedding in .xlsx is a file-format/library limitation rather than an omitted
font asset; PDF is the format to use when identical glyph rendering on every
device is required.
The design and progress live here rather than in CHANGELOG.md's TODO list so
implementation details stay beside the format they describe.