public byte[] DownFileWXPG(string ReportNO, string templdateName)
{
Код: Выделить всё
WXPGFormat(ReportNO);
document = new Document(templdateName);
document.Properties.FormFieldShading = false;
SpireDocHelper.InsertTablemarkByText(document, 0, DicFuzhu1);
document.Properties.FormFieldShading = false;
using (MemoryStream memoryStream = new MemoryStream())
{
document.SaveToStream(memoryStream, FileFormat.Doc);
byte[] bytes = memoryStream.ToArray();
return bytes;
}
public static void InsertTablemarkByText(Document document, intsectionIndex, Dictionary CanshuDic)
{
var разделFuzhu = document.Sections[SectionIndex].Body.FormFields;
Код: Выделить всё
foreach (FormField field in sectionFuzhu)
{
try
{
field.OwnerParagraph.AppendText(CanshuDic[field.Name]);
}
catch { }
}
Подробнее здесь: https://stackoverflow.com/questions/781 ... -documents