Exemple #1
0
        public MergeProcessor()
        {
            // Subscribe to the CalculateDocumentVariable event that triggers the master-detail report generation
            resultRichEdit.CalculateDocumentVariable += new CalculateDocumentVariableEventHandler(resultRichEdit_CalculateDocumentVariable);

            // Load main template
            mainRichEdit.LoadDocument("main.rtf");

            // Create project's data source
            ds = DataHelper.CreateData();

            // Load templates and specify data sources for RichEdit servers.

            suppllierRichEdit.LoadDocument("supplier.rtf");
            suppllierRichEdit.Options.MailMerge.DataSource = ds;

            productRichEdit.LoadDocument("detail.rtf");
            productRichEdit.Options.MailMerge.DataSource = ds;
            productRichEdit.Options.MailMerge.DataMember = "Products";

            ordersRichEdit.LoadDocument("detaildetail.rtf");
            ordersRichEdit.Options.MailMerge.DataSource = ds;
            ordersRichEdit.Options.MailMerge.DataMember = "Products.OrderDetails";
        }
Exemple #2
0
        public static SupplierCollection CreateData()
        {
            SupplierCollection suppliers = new SupplierCollection();

            Supplier supplier = new Supplier("Exotic Liquids");

            suppliers.Add(supplier);
            supplier.Add(CreateProduct(supplier.SupplierID, "Chai"));
            supplier.Add(CreateProduct(supplier.SupplierID, "Chang"));
            supplier.Add(CreateProduct(supplier.SupplierID, "Aniseed Syrup"));

            supplier = new Supplier("New Orleans Cajun Delights");
            suppliers.Add(supplier);
            supplier.Add(CreateProduct(supplier.SupplierID, "Chef Anton's Cajun Seasoning"));
            supplier.Add(CreateProduct(supplier.SupplierID, "Chef Anton's Gumbo Mix"));

            supplier = new Supplier("Grandma Kelly's Homestead");
            suppliers.Add(supplier);
            supplier.Add(CreateProduct(supplier.SupplierID, "Grandma's Boysenberry Spread"));
            supplier.Add(CreateProduct(supplier.SupplierID, "Uncle Bob's Organic Dried Pears"));
            supplier.Add(CreateProduct(supplier.SupplierID, "Northwoods Cranberry Sauce"));

            return(suppliers);
        }