I am trying to create a document where the marked portion of the word will be replaced with property value. I am able to achieve this with concrete class. But in out scenario the class is dynamic. So I am trying the same with Expandoobject. But it is throwing an error.
System.InvalidOperationException: 'An error has been encountered at the end of expression ‘document.Name]>’. Can not get the value of member ‘Name’ on type 'Aspose.ExpandoWrapper
Here is my code. How can I acheive this dynamically.?
Document doc = new Document(dataDir + fileName); // Create a Reporting Engine. ReportingEngine engine = new ReportingEngine(); var data = Common.GetManager(); dynamic wrapper = new ExpandoWrapper(data); // convert class to dynamic object. Console.WriteLine(wrapper.Name); // I have the data here // Execute the build report. engine.BuildReport(doc, wrapper, "document"); // error dataDir = dataDir + GetOutputFilePath(fileName); // Save the finished document to disk. doc.Save(dataDir);