diagram_core/src/report/shape.rs#
Source: lib/diagram_core/src/report/shape.rs
shape -- (NO-22, DA-13) a report's table on the page: a group of cell shapes instead of
Visio's embedded Excel object, found again and built anew in place
report_layer(tx, page, name, name_univ) -> index the layer of report tables (found by
its universal name, else added)
place(tx, eng, owner, top_left, &table, &Place) -> the group
report_shape(doc, shape) -> Option<ReportShape> the table a shape is (or is part of)
refresh(tx, eng, shape, &table) -> the new group the same place, marks and layers
The table: a title row (no line, no fill, 11 pt bold), the heading row (8 pt bold on a light
grey), the rows (8 pt; group headings, subtotals and the grand total bold, the totals on a
lighter grey), each cell a rectangle with its text (numeric columns right-aligned), grouped
with ops::group (the members scale with the group as in any group). Sizes are on paper
(rows 0.2 in, columns by their longest text, 0.5 to 3.5 in) and grow with the page's scale.
The group carries the marks: User.JFD_Report = 1, JFD_ReportName (the definition's name),
JFD_ReportDef (a copy of the definition's XML, Visio's "Kopie der Berichtsdefinition") or
JFD_ReportLink (where the definition is: "" the drawing's definition of that name, else the
path of a .vrd file, Visio's "Verknüpfung mit der Berichtsdefinition"); SelectMode 0 (a click
takes the table, not a cell). At most MAX_ROWS rows are drawn, then a row "…".
/// User cell of a report table: 1
MARK: &str = "JFD_Report"
/// User cell: the definition's name (STR)
MARK_NAME: &str = "JFD_ReportName"
/// User cell: a copy of the definition's XML (STR)
MARK_DEF: &str = "JFD_ReportDef"
/// User cell: where the definition is ("" the drawing, else a .vrd path; STR)
MARK_LINK: &str = "JFD_ReportLink"
/// the most rows a table shape draws
MAX_ROWS: usize = 2000
struct Placewhat a placed table carries besides its cellsname: String-- the definition's namedef_copy: Option<String>-- a copy of the definition (its XML), or None when it is linkedlink: Option<String>-- the link when it is not copied: "" the drawing's definition of that name, else a .vrd pathlayers: Vec<u32>-- the layers of the page the table and its cells go on
struct ReportShapea table shape found on a pageshape: ShapeRef-- the groupname: String-- JFD_ReportNamedef: Option<String>-- JFD_ReportDef (None: none or empty)link: Option<String>-- JFD_ReportLink (None: none)
fn report_shape(doc: &Document, shape: ShapeRef) -> Option<ReportShape>the report tableshapeis, or belongs to (a cell of it)fn report_layer(tx: &mut Transaction, page: PageRef, name: &str, name_univ: &str) -> Result<u32, EditError>the layer report tables go on: the page's layer with this universal name, else a new onefn place(tx: &mut Transaction, eng: &mut Engine, owner: Owner, at: [f64; 2], table: &Table, p: &Place) -> Result<ShapeRef, EditError>put a report's table on a page or master: its top left corner atat(page coordinates) -> the groupfn refresh(tx: &mut Transaction, eng: &mut Engine, shape: ShapeRef, table: &Table) -> Result<ShapeRef, EditError>build a report table anew where it is (its top left corner, its marks and layers stay), as part of the caller's transaction -> the new group