When i am trying to populate merge fields in a document template, when i reach the wordTemplate.process(); it tries to load a type 'System.Data.OleDb.OleDbType', but none is found. The project is a .net framework 4.7.2 class lib with a .net Core 2.1 UI lib.
I have tried doing this in an older asp.net website project that is targeting framework 4.7.2 as well, and there is works like a charm.
Error message:
WordWriter Error: Could not load type 'System.Data.OleDb.OleDbType' from assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e079'.
Full name of exception = "SoftArtisans.OfficeWriter.WordWriter.SAException"
I am simply trying to write a repeat block that replaces a merge field(this works in the asp.net website):
DataTable dt = new DataTable("Occassions");
dt.Columns.Add("AttentionNames");
foreach (AudAudiencePerson person in audiencePeopleToPrint)
{
DataRow row = dt.NewRow();
row["AttentionNames"] = "Mathias";
dt.Rows.Add(row);
}
WordTemplate wordTemplate = new WordTemplate();
wordTemplate.Open(@"pathToTemplate\BasicTemplate.docx");
wordTemplate.SetRepeatBlock(dt, "Repeat");
wordTemplate.Process();
MemoryStream ms = new MemoryStream();
wordTemplate.Save(ms);
What am i missing here?