Hi,
I am trying to use LINQ Reporting Engine, with datasource XML, but i have this error :
FAILED - An error has been encountered at the end of expression ‘id.dataInfrazione]>’. Can not get the value of member ‘dataInfrazione’ on type ‘class com.aspose.words.net.System.Data.DataRowCollection’.
This my xml :
<dati>
<id nomefile="STDV10074974S2019" nr="620_22-07-2021_12-28-09-558" ordine_stampa="0">
<template>template1</template>
<DataInfrazione>24/07/2021</DataInfrazione>
</id>
</dati>
and this is my code :
try
{
var loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.DOCX);
var destinationFile = destination + File.separator + filename.getName();
// Carico il documento Aspose Words
var doc = new Document(filename.toString(), loadOptions);
// Setto la classe custom per il merge field
final var mergeFieldCustom = new MergeFiledCustomTest();
ReportingEngine engine = new ReportingEngine();
doc.getMailMerge().setFieldMergingCallback(mergeFieldCustom);
File dati = ResourceUtils.getFile("classpath:dati2.xml");
DataSet ds = new DataSet();
ds.readXml(dati.toPath().toString());
engine.buildReport(doc, ds, "dati");
My template has only 1 row :
<<[id.dataInfrazione]>>
Where am I wrong ?
Thanks.
Samuele