MemberAdminWindow: Add pending member movement export
This commit is contained in:
@@ -109,8 +109,13 @@ namespace Elwig.Helpers.Export {
|
||||
<style:paragraph-properties fo:text-align="center"/>
|
||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="sectionheader" style:family="table-cell" style:parent-style-name="default">
|
||||
<style:table-cell-properties style:text-align-source="fix" style:repeat-content="false"/>
|
||||
<style:paragraph-properties fo:text-align="left"/>
|
||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold" fo:font-size="14pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="th" style:family="table-cell" style:parent-style-name="default">
|
||||
<style:table-cell-properties style:text-align-source="fix" style:repeat-content="false" style:vertical-align="middle"/>
|
||||
<style:table-cell-properties style:text-align-source="fix" style:repeat-content="false" style:vertical-align="middle" fo:wrap-option="wrap"/>
|
||||
<style:paragraph-properties fo:text-align="center"/>
|
||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
@@ -211,35 +216,59 @@ namespace Elwig.Helpers.Export {
|
||||
}
|
||||
}
|
||||
|
||||
await Content.WriteAsync(
|
||||
$" <table:table-row>\r\n" +
|
||||
FormatCell(table.FullName, colSpan: totalSpan, style: "header") +
|
||||
$" </table:table-row>\r\n" +
|
||||
$" <table:table-row>\r\n" +
|
||||
FormatCell(table.Subtitle, colSpan: totalSpan, style: "subheader") +
|
||||
$" </table:table-row>\r\n" +
|
||||
$" <table:table-row>\r\n" +
|
||||
$" <table:table-cell table:number-columns-repeated=\"{totalSpan}\"/>\r\n" +
|
||||
$" </table:table-row>\r\n" +
|
||||
$" <table:table-row>\r\n");
|
||||
foreach (var (name, span, units) in table.ColumnNames.Zip(table.ColumnSpans, table.ColumnUnits)) {
|
||||
var hasUnits = units.Length > 0;
|
||||
await Content.WriteAsync(FormatCell(name, colSpan: span, rowSpan: hasUnits ? 1 : 2, style: "th"));
|
||||
}
|
||||
await Content.WriteAsync(" </table:table-row>\r\n <table:table-row>\r\n");
|
||||
foreach (var (span, units) in table.ColumnSpans.Zip(table.ColumnUnits)) {
|
||||
if (units.Length == 0) {
|
||||
await Content.WriteAsync($" <table:covered-table-cell table:number-columns-repeated=\"{span}\"/>\r\n");
|
||||
continue;
|
||||
}
|
||||
foreach (var u in units) {
|
||||
await Content.WriteAsync(FormatCell(u == null ? null : $"[{u}]", style: "th"));
|
||||
}
|
||||
}
|
||||
await Content.WriteAsync(" </table:table-row>\r\n");
|
||||
await Content.WriteAsync($"""
|
||||
<table:table-row>
|
||||
{FormatCell(table.FullName, colSpan: totalSpan, style: "header")}
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
{FormatCell(table.Subtitle, colSpan: totalSpan, style: "subheader")}
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:number-columns-repeated="{totalSpan}"/>
|
||||
</table:table-row>
|
||||
""");
|
||||
|
||||
foreach (var row in table.GetData()) {
|
||||
await FormatRow(row, table.ColumnUnits, mergeSubRowCells);
|
||||
var firstSection = true;
|
||||
foreach (var sec in table.GetData()) {
|
||||
if (!firstSection) {
|
||||
await Content.WriteAsync($"""
|
||||
<table:table-row>
|
||||
<table:table-cell table:number-columns-repeated="{totalSpan}"/>
|
||||
</table:table-row>
|
||||
<table:table-row>
|
||||
<table:table-cell table:number-columns-repeated="{totalSpan}"/>
|
||||
</table:table-row>
|
||||
""");
|
||||
}
|
||||
if (sec.Name != null) {
|
||||
await Content.WriteAsync($"""
|
||||
<table:table-row>
|
||||
{FormatCell(sec.Name, colSpan: totalSpan, style: "sectionheader")}
|
||||
</table:table-row>
|
||||
""");
|
||||
}
|
||||
|
||||
await Content.WriteAsync(" <table:table-row>\r\n");
|
||||
foreach (var (name, span, units) in table.ColumnNames.Zip(table.ColumnSpans, table.ColumnUnits)) {
|
||||
var hasUnits = units.Length > 0;
|
||||
await Content.WriteAsync(FormatCell(name, colSpan: span, rowSpan: hasUnits ? 1 : 2, style: "th"));
|
||||
}
|
||||
await Content.WriteAsync(" </table:table-row>\r\n <table:table-row>\r\n");
|
||||
foreach (var (span, units) in table.ColumnSpans.Zip(table.ColumnUnits)) {
|
||||
if (units.Length == 0) {
|
||||
await Content.WriteAsync($" <table:covered-table-cell table:number-columns-repeated=\"{span}\"/>\r\n");
|
||||
continue;
|
||||
}
|
||||
foreach (var u in units) {
|
||||
await Content.WriteAsync(FormatCell(u == null ? null : $"[{u}]", style: "th"));
|
||||
}
|
||||
}
|
||||
await Content.WriteAsync(" </table:table-row>\r\n");
|
||||
|
||||
foreach (var row in sec.Rows) {
|
||||
await FormatRow(row, table.ColumnUnits, mergeSubRowCells);
|
||||
}
|
||||
firstSection = false;
|
||||
}
|
||||
|
||||
await Content.WriteAsync(" </table:table>\r\n");
|
||||
@@ -314,7 +343,8 @@ namespace Elwig.Helpers.Export {
|
||||
}
|
||||
c = $"<{ct} office:value-type=\"float\" calcext:value-type=\"float\" office:value=\"{v.ToString(CultureInfo.InvariantCulture)}\"{add}><text:p>{data}</text:p></{ct}>";
|
||||
} else {
|
||||
c = $"<{ct} office:value-type=\"string\" calcext:value-type=\"string\"{add}><text:p>{SecurityElement.Escape(data.ToString())}</text:p></{ct}>";
|
||||
var lines = string.Join("", data.ToString()?.Split('\n').Select(l => $"<text:p>{SecurityElement.Escape(l)}</text:p>") ?? []);
|
||||
c = $"<{ct} office:value-type=\"string\" calcext:value-type=\"string\"{add}>{lines}</{ct}>";
|
||||
}
|
||||
|
||||
return $" {c}\r\n" + (colSpan > 1 ? $" <table:covered-table-cell table:number-columns-repeated=\"{colSpan - 1}\"/>\r\n" : "");
|
||||
|
||||
Reference in New Issue
Block a user