From 1caf3fee3bb517b19218452fab566bce36a26a80 Mon Sep 17 00:00:00 2001 From: meld-cp <18450687+meld-cp@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:27:03 +1200 Subject: [PATCH] add $= formula handling with $enumrowstart/end placeholder replacments (#621) Co-authored-by: meld-cp <18450687+meld-cp@users.noreply.github.com> --- ...plateBasicIEnumerableFillWithFormulas.xlsx | Bin 0 -> 9663 bytes .../OpenXml/ExcelOpenXmlTemplate.Impl.cs | 34 ++++++++++++++++++ .../MiniExcelTests/MiniExcelTemplateTests.cs | 28 +++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 samples/xlsx/TestTemplateBasicIEnumerableFillWithFormulas.xlsx diff --git a/samples/xlsx/TestTemplateBasicIEnumerableFillWithFormulas.xlsx b/samples/xlsx/TestTemplateBasicIEnumerableFillWithFormulas.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e6105036fa6f9eb988950ba714da2f6717b3153e GIT binary patch literal 9663 zcmeHtg;!k3_I2Y9jRkiI4vo9JTOc?=8Yhi=kj8>bkPryL6QFSmPH=)-@Zb>K2^RP< zc{AV4Waj$|-n+e4)w-+iKI`79v(K(Nr!-X%5D5Ut08{_~Km)Kicx!742LL1>0s!~` zRCps9$a8n_b9b{RKF(k_6Ao`DN9tTec&2Os{KNDAyZ(zu0G2$U-U$NAeOJ7dS!Y*X zsFFnG+lThzv1p06cfIN{_w1%)THU@s0YAvd)OP^$5gRux5^6&v;>IIy<)8~gjVF~von zX(K-EzMlPj&7VBzqS9P z<9{&+|MKauBsGmr5N7zH;%!9V_o>AMptOpYlwuRjlYk(l1)SR0JbJRlHb!#b6Vea_ zg}|18+t2fhqOm)DG#9J9uxLC25xP3B((trv7Y`Jc$F8aJF0hp@T+gZVsf%<4WgjNb zmUxzuj~{YW`j_bBCyr$+fg>DGNzw2N$ip9rr3V}Ks2O~yd$liH1 zk`XwaTDXlR@lr^2Z#iJk>>o0R9DAV$gaX7%T<`x$IQyH{Zuxi4gZHf zy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