Nested Mailmerge Sample

Hi all,

Anyone has any idea the difference between the Template_letter and Template report. The former will page break nicely. I see the codes for executing both the same. It must be something in the former doc that cause it to page break after the <>. Can someone help?

Regards



1 Reply

BP Bhuvaneswari P Syncfusion Team October 23, 2008 10:31 AM UTC

Hi Farouk,

This page break due to the input command string we passed in the sample. In this sample for Template_letter we retrieved 3 employees(Select TOP 3 * from, Employees ) next command SELECT DISTINCT TOP 2... – we
take ONLY! 2 customers for each employee and then the command "Orders", "SELECT DISTINCT TOP 2 - we take only 2 orders for each.
So first one employee record followed by 2 customer records then 2 order record after the page is over, so it goes o next page. You can test this by increase the number of order and customer record, and then see the output it looks like Template_Report.

Change the code like below:
DictionaryEntry entry = new DictionaryEntry("Employees", "Select TOP 10 * from Employees");
commands.Add(entry);

// To retrive customer details
entry = new DictionaryEntry("Customers", "SELECT DISTINCT TOP 10 Employees.EmployeeID, Customers.CustomerID,Customers.CompanyName, Customers.ContactName, Customers.Address, Customers.City, Customers.Country FROM ((Orders INNER JOIN Employees ON Orders.EmployeeID = Employees.EmployeeID) INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID) WHERE Employees.EmployeeID = %Employees.EmployeeID%");
commands.Add(entry);

//To retrieve order details
entry = new DictionaryEntry( "Orders", "SELECT DISTINCT TOP 10 OrderID, OrderDate, RequiredDate, ShippedDate FROM Orders WHERE Orders.CustomerID = '%Customers.CustomerID%' AND Orders.EmployeeID = %Employees.EmployeeID%" );
commands.Add(entry);

Please try this and let us know if you need any further clarification.

Best Regards,
Bhuvana



Loader.
Up arrow icon