Liking cljdoc? Tell your friends :D

excel-templates.build


add-sheet-namesclj

(add-sheet-names replacements)

For replacements that don't have an explicit sheet name, add a unique one.

For replacements that don't have an explicit sheet name, add a unique one.
sourceraw docstring

build-base-outputclj

(build-base-output template-file output-file)

Build an output file with all the rows stripped out. This keeps all the styles and annotations while letting us write the spreadsheet using streaming so it can be arbitrarily large

Build an output file with all the rows stripped out.
This keeps all the styles and annotations while letting us write the
spreadsheet using streaming so it can be arbitrarily large
sourceraw docstring

cell-seqclj

(cell-seq sheet)

Return a lazy seq of cells on the sheet in row major order (that is, across and then down)

Return a lazy seq of cells on the sheet in row major order (that is, across
and then down)
sourceraw docstring

charts-from-fileclj

(charts-from-file excel-file)

Extract the chart info from a file

Extract the chart info from a file
sourceraw docstring

clone-sheet!clj

(clone-sheet! workbook template-sheet-name dest-sheet-name target-loc)
source

copy-rowclj

(copy-row translation-table wb sheet src-row dst-row)

Copy a single row of data from the template to the output, and the styles with them

Copy a single row of data from the template to the output, and the styles with them
sourceraw docstring

copy-stylesclj

(copy-styles wb src-row dst-row)

Copy the styles from one row to another. We don't really copy, but rather assume that the styles with the same index in the source and destination are the same. This works since the destination is a copy of the source.

Copy the styles from one row to another. We don't really copy, but rather
assume that the styles with the same index in the source and destination
are the same. This works since the destination is a copy of the source.
sourceraw docstring

create-missing-sheets!clj

(create-missing-sheets! excel-file replacements chart-data)

Updates the excel file with any missing sheets, referred to by :sheet-name in the replacements.

Updates the excel file with any missing sheets, referred to by :sheet-name
in the replacements.
sourceraw docstring

create-temp-xlsx-fileclj

(create-temp-xlsx-file prefix)

Create a temp file with correct headers to be opened by OPCPackage

Create a temp file with correct headers to be opened by OPCPackage
sourceraw docstring

expand-replacementsclj

(expand-replacements replacements)

Expand any keys of the form [start end] in the replacement map to being individual row keys

Expand any keys of the form [start end] in the replacement map to being individual row
keys
sourceraw docstring

extract-chartsclj

(extract-charts workbook)

Get all the charts on the various sheets and return their XML as a dictionary keyed by sheet name. Then, delete the charts from the original workbook.

This is necessary because POI has a bug cloning sheets with charts on them. See https://github.com/tomfaulhaber/excel-templates/issues/7 for info.

Get all the charts on the various sheets and return their XML as a dictionary
keyed by sheet name. Then, delete the charts from the original workbook.

This is necessary because POI has a bug cloning sheets with charts on them.
See https://github.com/tomfaulhaber/excel-templates/issues/7 for info.
sourceraw docstring

filter-zip-fileclj

(filter-zip-file input-file output-file rules)

Filter zip file copies the zip file deleting and modifying the entries according to the rules provided

Filter zip file copies the zip file deleting and modifying the entries according to the rules
provided
sourceraw docstring

formula?clj

(formula? cell)

Return true if src-cell has a formula

Return true if src-cell has a formula
sourceraw docstring

get-all-sheet-namesclj

(get-all-sheet-names wb)
source

get-sheet-indexclj

(get-sheet-index workbook sheet-name)
source

get-sheet-namesclj

(get-sheet-names wb)

Get all the sheet names in a workbook in the order they appear

Get all the sheet names in a workbook in the order they appear
sourceraw docstring

get-sheetsclj

(get-sheets wb)

Get all the sheet objects in a workbook in the order they appear

Get all the sheet objects in a workbook in the order they appear
sourceraw docstring

get-templateclj

(get-template template-file)

Get a file by its pathname or, if that's not found, use the resources

Get a file by its pathname or, if that's not found, use the resources
sourceraw docstring

get-valclj

(get-val cell)

Get the value from a cell depending on the type

Get the value from a cell depending on the type
sourceraw docstring

has-formula?clj

(has-formula? sheet)

returns true if any of the cells on the sheet are calculated

returns true if *any* of the cells on the sheet are calculated
sourceraw docstring

IExcelValuecljprotocol

excel-valclj

(excel-val val wb)
source

indexedclj

(indexed coll)

For the collection coll with elements x0..xn, return a lazy sequence of pairs [0 x0]..[n xn]

For the collection coll with elements x0..xn, return a lazy sequence
of pairs [0 x0]..[n xn]
sourceraw docstring

inject-data-rowclj

(inject-data-row data-row translation-table wb sheet src-row dst-row)

Take the data from the collection data-row and set the cell values in the target row accordingly. If there are any nil values in the source collection, the corresponding cells are not modified.

Take the data from the collection data-row and set the cell values in the target row accordingly.
If there are any nil values in the source collection, the corresponding cells are not modified.
sourceraw docstring

insert-chartsclj

(insert-charts workbook chart-data src-sheet dst-sheet src-index target-loc)

Add the charts back into the sheets

Add the charts back into the sheets
sourceraw docstring

memfnxcljmacro

(memfnx method n-args)

Like memfn, but gives n-args arguments so I don't have to name them.

Like memfn, but gives n-args arguments so I don't have to name them.
sourceraw docstring

normalizeclj

(normalize replacements)

Convert replacements to their verbose form.

  • TODO allow single map of replacements to default sheet (0))
  • make sheet-datas vectors
  • add explicity :sheet-name to each sheet-data
Convert replacements to their verbose form.
* TODO allow single map of replacements to default sheet (0))
* make sheet-datas vectors
* add explicity :sheet-name to each sheet-data
sourceraw docstring

pad-sheet-rows!clj

(pad-sheet-rows! sheet replacements)

Make sure that the sheet has at least the rows it needs to handle the incoming replacements.

Make sure that the sheet has at least the rows it needs to handle the
incoming replacements.
sourceraw docstring

remove-sheet!clj

(remove-sheet! workbook sheet-name)
source

render-to-fileclj

(render-to-file template-file output-file replacements)

Build a report based on a spreadsheet template

Build a report based on a spreadsheet template
sourceraw docstring

render-to-streamclj

(render-to-stream template-file output-stream replacements)

Build a report based on a spreadsheet template, write it to the output stream.

Build a report based on a spreadsheet template, write it to the output
stream.
sourceraw docstring

replacements-by-sheet-nameclj

(replacements-by-sheet-name replacements)

Convert replacements to a map of concrete sheet name -> sheet data map.

{'Sheet1' [{:sheet-name 'Sheet1-1' ...} {:sheet-name 'Sheet1-2' ...}]}

=>

{'Sheet1-1' {...} 'Sheet1-2' {...}}

Convert replacements to a map of concrete sheet name -> sheet data map.

{'Sheet1' [{:sheet-name 'Sheet1-1' ...} {:sheet-name 'Sheet1-2' ...}]}

=>

{'Sheet1-1' {...}
 'Sheet1-2' {...}}
sourceraw docstring

row-map?clj

(row-map? data)

Returns true if this structure is a row-map. The difference between a row map and a worksheet map is that a row map doesn't contain any other maps and a worksheet map does.

Returns true if this structure is a row-map. The difference
between a row map and a worksheet map is that a row map doesn't
contain any other maps and a worksheet map does.
sourceraw docstring

save-workbook!clj

(save-workbook! workbook file)
source

set-formulaclj

(set-formula wb cell formula)

Set the formula for the given cell

Set the formula for the given cell
sourceraw docstring

set-valclj

(set-val wb cell val)

Set the value in the given cell, depending on the type

Set the value in the given cell, depending on the type
sourceraw docstring

xml-to-strclj

(xml-to-str xml-data)

Generate an XML string from parsed XML using clojure.xml

Generate an XML string from parsed XML using clojure.xml
sourceraw docstring

zipclj

(zip s1 s2)

mix together two seqs like (zip [a b c] [x y z]) => [[a x] [b y] [c z]]

mix together two seqs like (zip [a b c] [x y z]) => [[a x] [b y] [c z]]
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close