XmlDataLoadOptions.AlwaysGenerateRootObject
XmlDataLoadOptions AlwaysGenerateRootObject property. Gets or sets a flag indicating whether a generated data source will always contain an object for an XML root element. If an XML root element has no attributes and all its child elements have same names such an object is not created by default.
XmlDataLoadOptions.AlwaysGenerateRootObject property
Gets or sets a flag indicating whether a generated data source will always contain an object for an XML root element. If an XML root element has no attributes and all its child elements have same names, such an object is not created by default.
public bool AlwaysGenerateRootObject { get; set; }
Examples
Shows how to fill a template from a XML file using LINQ Reporting Engine and save the result to stream.
XmlDataLoadOptions xmlLoadOptions = new XmlDataLoadOptions();
xmlLoadOptions.AlwaysGenerateRootObject = true;
XmlDataSource ds = new XmlDataSource(MyDir + "ReportingData.xml", xmlLoadOptions);
using (Stream input = File.OpenRead(MyDir + "ReportingTemplateForeach.docx"))
using (Stream output = File.Create(ArtifactsDir + "ReportingForeachXmlDataSource.pdf"))
{
ReportBuilder.BuildReport(input, output, SaveFormat.Pdf, ds);
}
See Also
- class XmlDataLoadOptions
- namespace Wordize.Reporting
- assembly Wordize