Hi,
I use Aspose to fill a Word document, which contains multiple mergefields and loops like the loop example below.
«TD_AP_FE_FinEconCapacity»
«TableStart:FinEcCapacity»«LotTitle»
· «TableStart:FinEcCapacityLines»«FinEconCapacity»
«FinEconCapacityDetails»«TableEnd:FinEcCapacityLines»«TableEnd:FinEcCapacity»
For each loop in the template I have a stored procedure at database level which gives me the data. This data is inserted in a datatable (eg dt_x). So for each loop in the template I call the Execute method on my doc object.
e.g.
doc.MailMerge.Execute(dt_x); //dt_x = datatable which contains data of stored procedure x
doc.MailMerge.Execute(dt_y); //dt_y = datatable which contains data of stored procedure y
doc.MailMerge.Execute(dt_z); //dt_z = datatable which contains data of stored procedure z
The problem is that these “Execute” lines of code or very slow…
What’s the best way to fill the template with data coming from different stored procedures?
Thanks in advance.
Regards,
Kim