Hello,
I’m sorry to ask this question which should be already answered, but I don’t find the answer.
My problem is:
I would like put differents data with a ExecuteWithRegions linked to others data found by a simple Execute.
For exemple if I based my probleme to the sample SaleInvoiceDemo, I would like to generate a Word document for the Orders 10444 and 10445 and 10446 with their details.
Actually I try to make SQL Request with “Where OrderID>10443 And OrderID<10447” It’s working for each order (simple Exectue) but I get the details of all orders; and not only for the order selected (normal).
May I need to use a DataSet ???
Thanks for Help.
Francois
Here my code:
{
…
doc.MailMerge.Execute(GetTestOrder());
DataView orderDetails = new DataView(GetTestOrderDetails());
orderDetails.Sort = “ExtendedPrice DESC”;
doc.MailMerge.ExecuteWithRegions(orderDetails);
}private DataTable GetTestOrder()
{
DataTable table = base.ExecuteDataTable(string.Format(“SELECT * FROM AsposeWordOrders WHERE OrderID>10443 And OrderID<10447”));
table.TableName = “Orders”;return table;
}private DataTable GetTestOrderDetails()
{
DataTable table = ExecuteDataTable(string.Format(“SELECT * FROM AsposeWordOrderDetails WHERE OrderID>10443 And OrderID<10449 ORDER BY ProductID”));
table.TableName = “OrderDetails”;return table;
}