Exemplo n.º 1
0
        private void btn_NonPrintableBrick_Click(object sender, EventArgs e)
        {
            BrickGraphics graph = printingSystem1.Graph;

            // Start the report generation.
            printingSystem1.Begin();

            // Set the modifier - specify the page area.
            graph.Modifier = BrickModifier.MarginalHeader;

            string format = "Page {0} of {1}";

            graph.Font      = graph.DefaultFont;
            graph.BackColor = Color.Transparent;
            RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height);
            // Create a brick.
            PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format,
                                                     Color.Black, r, BorderSide.None);

            brick.Alignment = BrickAlignment.Far;
            brick.AutoWidth = true;

            // Create another brick with different alignment.
            brick = graph.DrawPageInfo(PageInfo.DateTime, "{0:MMMM dd}", Color.Black, r, BorderSide.None);

            // Change the page area - set the modifier.
            printingSystem1.Graph.Modifier = BrickModifier.DetailHeader;

            graph.BackColor = Color.Silver;

            // Create a brick, which will be hidden in the printout.
            TextBrick tBrick = new TextBrick(BorderSide.None, 1, Color.Black, Color.Khaki, Color.Blue);

            tBrick.Url        = "http://www.devexpress.com";
            tBrick.Text       = "Click here to visit our web site";
            tBrick.CanPublish = false;
            printingSystem1.Graph.DrawBrick(tBrick, new RectangleF(0, 0, 200, 20));

            // Create a brick - a column header.
            printingSystem1.Graph.DrawString("Report Items", Color.Black,
                                             new RectangleF(0, 20, 200, 20), BorderSide.All);

            // Change the page area - set the modifier.
            printingSystem1.Graph.Modifier = BrickModifier.Detail;

            graph.BackColor = Color.White;

            // Create bricks.
            for (int i = 0; i < 100; i++)
            {
                printingSystem1.Graph.DrawString("Item N" + Convert.ToString(i + 1),
                                                 Color.Black, new RectangleF(0, 20 * i, 200, 20), BorderSide.All);
            }

            // Finish the report generation.
            printingSystem1.End();

            // Preview the report.
            printingSystem1.PreviewFormEx.Show();
        }
Exemplo n.º 2
0
        private void btn_DrawPageInfo_Click(object sender, EventArgs e)
        {
            PageInfoBrick pinfoBrick;
            BrickGraphics brickGraph = printingSystem1.Graph;

            // Start the report generation.
            printingSystem1.Begin();

            // Create a rectangle.
            RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(250, 20));

            // Specify the page header.
            brickGraph.Modifier = BrickModifier.MarginalHeader;
            // Create page info brick to display time in full format.
            pinfoBrick = brickGraph.DrawPageInfo(PageInfo.DateTime, "{0:F}", Color.Black, rect, BorderSide.None);
            // Specify the page footer.
            brickGraph.Modifier = BrickModifier.MarginalFooter;
            // Create a page info brick to display page number.
            pinfoBrick = brickGraph.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, rect, BorderSide.None);

            // Finish the report generation.
            printingSystem1.End();

            // Preview the report.
            printingSystem1.PreviewFormEx.Show();
        }
Exemplo n.º 3
0
        protected override void CreateMarginalHeader(BrickGraphics graph)
        {
            // Set the format string for a page info brick.
            string format = "Page {0} of {1}";

            // Set font to the default font.
            graph.Font = graph.DefaultFont;

            // Set the background color to Transparent.
            graph.BackColor = Color.Transparent;

            // Set the rectangle for drawing.
            RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height);

            // Add a page info brick without borders that displays
            // the current page number from the total number of pages.
            PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None);

            // Set brick alignment.
            brick.Alignment = BrickAlignment.Far;

            // Enable auto width for a brick.
            brick.AutoWidth = true;

            // Add a page info brick without borders
            // that displays date and time.
            brick = graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None);

            // Set brick alignment.
            brick.Alignment = BrickAlignment.Near;

            // Enable auto width for a brick.
            brick.AutoWidth = true;
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            BrickGraphics graph = printingSystem1.Graph;

            // Start the report generation.
            printingSystem1.Begin();

            // Set the modifier - specify the page area.
            graph.Modifier = BrickModifier.MarginalHeader;

            string format = "Page {0} of {1}";

            graph.Font      = graph.DefaultFont;
            graph.BackColor = Color.Transparent;
            RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height);

            // Create a brick.
            PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal,
                                                     format, Color.Black, r, BorderSide.None);

            brick.Alignment = BrickAlignment.Far;
            brick.AutoWidth = true;

            // Create another brick with different alignment.
            brick = graph.DrawPageInfo(PageInfo.DateTime, "{0:MMMM dd}",
                                       Color.Black, r, BorderSide.None);



            // Change the page area - set the modifier.
            printingSystem1.Graph.Modifier = BrickModifier.DetailHeader;

            graph.BackColor = Color.Silver;

            // Create a brick.
            printingSystem1.Graph.DrawString("Report Items", Color.Black,
                                             new RectangleF(0, 0, 200, 20), BorderSide.All);



            // Change the page area - set the modifier.
            printingSystem1.Graph.Modifier = BrickModifier.Detail;

            graph.BackColor = Color.White;

            // Create bricks.
            for (int i = 0; i < 100; i++)
            {
                printingSystem1.Graph.DrawString("Item N" + Convert.ToString(i + 1),
                                                 Color.Black, new RectangleF(0, 20 * i, 200, 20), BorderSide.All);
            }


            printingSystem1.End();
            printingSystem1.PreviewFormEx.Show();
        }
Exemplo n.º 5
0
        private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e)
        {
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics = e.Graph;

            brickGraphics.BackColor = Color.White;
            brickGraphics.Font      = new Font("Arial", 8);

            // Declare bricks.
            PageInfoBrick  pageInfoBrick;
            PageImageBrick pageImageBrick;

            // Declare text strings.
            string devexpress = "XtraPrintingSystem by Developer Express Inc.";

            // Define the image to display.
            //Image pageImage = Image.FromFile(@"..\..\logo.png");
            Image pageImage = new Bitmap(1, 1);//= Properties.Resources.excel32;

            // Display the DevExpress text string.
            SizeF size = brickGraphics.MeasureString(devexpress);

            pageInfoBrick = brickGraphics.DrawPageInfo(PageInfo.None, devexpress, Color.Black, new RectangleF(new
                                                                                                              PointF(/*343 -*/ 100 - (size.Width - pageImage.Width) / 2, pageImage.Height + 3), size), BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Center;

            // Display the PageImageBrick containing the DevExpress logo.
            pageImageBrick = brickGraphics.DrawPageImage(pageImage, new RectangleF(1, 0,
                                                                                   pageImage.Width, pageImage.Height), BorderSide.None, Color.Transparent);
            //pageImageBrick.Alignment = BrickAlignment.Center;

            // Set the rectangle for a page info brick.
            RectangleF r = RectangleF.Empty;

            r.Height = 20;

            // Display the PageInfoBrick containing date-time information. Date-time information is displayed
            // in the left part of the MarginalHeader section using the FullDateTimePattern.
            pageInfoBrick           = brickGraphics.DrawPageInfo(PageInfo.DateTime, "{0:F}", Color.Black, r, BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Near;

            // Display the PageInfoBrick containing the page number among total pages. The page number
            // is displayed in the right part of the MarginalHeader section.
            pageInfoBrick = brickGraphics.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, r,
                                                       BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Far;
        }
Exemplo n.º 6
0
        protected override void CreateMarginalHeader(BrickGraphics gr)
        {
            gr.Modifier = BrickModifier.MarginalHeader;
            string        format = "Printed on {0:MMMM, dd}";
            PageInfoBrick brick  = gr.DrawPageInfo(PageInfo.DateTime, format, Color.Black,
                                                   new RectangleF(0, 0, 0, 20), BorderSide.None);

            brick.Alignment = BrickAlignment.Far;
            brick.AutoWidth = true;
        }
Exemplo n.º 7
0
        protected override void CreateMarginalFooter(BrickGraphics gr)
        {
            gr.Modifier = BrickModifier.MarginalFooter;
            string        format = "Page {0} of {1}";
            PageInfoBrick brick  = gr.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black,
                                                   new RectangleF(0, 0, 0, 20), BorderSide.None);

            brick.Alignment = BrickAlignment.Far;
            brick.AutoWidth = true;
        }
Exemplo n.º 8
0
        private void CreatePageFooter(BrickGraphics gr)
        {
            gr.Font      = new Font("Arial", 8, FontStyle.Underline);
            gr.BackColor = Color.Transparent;
            gr.Modifier  = BrickModifier.MarginalFooter;

            RectangleF r = new RectangleF(0, 0, 0, gr.Font.Height);

            PageInfoBrick brick = gr.DrawPageInfo(PageInfo.Number, "XtraPrintingSystem by Developer Express inc.", Color.Blue, r, BorderSide.None);

            brick.Hint      = brick.Url = "www.devexpress.com";
            brick.Alignment = BrickAlignment.Far;
            brick.AutoWidth = true;
        }
Exemplo n.º 9
0
        private void PrintableComponentLink_CreateReportHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e)
        {
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics = e.Graph;

            brickGraphics.BackColor = Color.White;
            brickGraphics.Font      = new Font("Times New Roman", 8);

            // Declare bricks.
            PageInfoBrick  pageInfoBrick;
            PageImageBrick pageImageBrick;

            // Define the image to display.
            Image pageImage = TaxesSystem.Properties.Resources.logo_option2;

            // Display the PageImageBrick containing the DevExpress logo.
            pageImageBrick           = brickGraphics.DrawPageImage(pageImage, new Rectangle(856, 0, 100, 120), BorderSide.None, Color.Transparent);
            pageImageBrick.Alignment = BrickAlignment.Far;

            // Display the PageInfoBrick containing date-time information. Date-time information is displayed
            // in the left part of the MarginalHeader section using the FullDateTimePattern.
            //{0:F}
            pageInfoBrick           = brickGraphics.DrawPageInfo(PageInfo.DateTime, "{0:MM/dd/yyyy hh:mm tt}", Color.Black, new Rectangle(840, 130, 120, 50), BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Far;


            // Declare text strings.
            string devexpress = title;
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics2 = e.Graph;

            brickGraphics2.BackColor = Color.White;
            brickGraphics2.Font      = new Font("Times New Roman", 16, FontStyle.Bold);

            // Display the DevExpress text string.
            SizeF size = brickGraphics2.MeasureString(devexpress);

            pageInfoBrick               = brickGraphics2.DrawPageInfo(PageInfo.None, devexpress, Color.Black, new RectangleF(new PointF(440, 50), size), BorderSide.None);
            pageInfoBrick.Alignment     = BrickAlignment.Center;
            pageInfoBrick.HorzAlignment = DevExpress.Utils.HorzAlignment.Center;
        }
Exemplo n.º 10
0
        private void PrintableComponentLink_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e)
        {
            // Declare bricks.
            PageInfoBrick pageInfoBrick;

            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics = e.Graph;

            brickGraphics.BackColor = Color.White;
            brickGraphics.Font      = new Font("Neo Sans Arabic", 8);

            // Set the rectangle for a page info brick.
            RectangleF r = RectangleF.Empty;

            r.Height = 20;

            // Display the PageInfoBrick containing the page number among total pages. The page number
            // is displayed in the right part of the MarginalHeader section.
            pageInfoBrick           = brickGraphics.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, r, BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Far;
        }
Exemplo n.º 11
0
        private void CreatePageHeader(BrickGraphics gr, string reportName, Image imgTitle, Color c)
        {
            gr.BackColor = Color.Transparent;
            gr.Modifier  = BrickModifier.MarginalHeader;

            gr.Font = new Font("Arial", 16, FontStyle.Bold);

            RectangleF r = new RectangleF(0, 0, 0, gr.Font.Height);

            PageTableBrick ptBrick = new PageTableBrick();
            TableRow       row     = new TableRow();
            PageImageBrick piBrick = new PageImageBrick();

            piBrick.Image     = imgTitle;
            piBrick.Rect      = new RectangleF(0, 0, imgTitle.Width, imgTitle.Height);
            piBrick.Sides     = BorderSide.None;
            piBrick.BackColor = Color.Transparent;
            row.Bricks.Add(piBrick);
            ptBrick.Rows.Add(row);
            row = new TableRow();
            PageInfoBrick pinfBrick = new PageInfoBrick();

            pinfBrick.Format    = reportName;
            pinfBrick.ForeColor = c;
            pinfBrick.Rect      = r;
            pinfBrick.Sides     = BorderSide.None;
            row.Bricks.Add(pinfBrick);
            ptBrick.Rows.Add(row);
            gr.DrawBrick(ptBrick);
            ptBrick.UpdateSize();

            gr.Font                 = gr.DefaultFont;
            pinfBrick               = gr.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, r, BorderSide.None);
            pinfBrick.Alignment     = BrickAlignment.Far;
            pinfBrick.LineAlignment = BrickAlignment.Center;
            pinfBrick.AutoWidth     = true;
        }
Exemplo n.º 12
0
        private void PrintableComponentLink_CreateReportHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e)
        {
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics = e.Graph;

            Height = 100;
            brickGraphics.BackColor = Color.White;
            brickGraphics.Font      = new Font("Neo Sans Arabic", 10);

            // Declare bricks.
            PageInfoBrick  pageInfoBrickFrom;
            PageInfoBrick  pageInfoBrickTo;
            PageInfoBrick  pageInfoBrick;
            PageInfoBrick  pageInfo;
            PageInfoBrick  pageInfo1;
            PageImageBrick pageImageBrick;

            // Define the image to display.
            Image pageImage = TaxesSystem.Properties.Resources.logo_option2;

            // Display the PageImageBrick containing the DevExpress logo.
            pageImageBrick           = brickGraphics.DrawPageImage(pageImage, new Rectangle(10, 0, 80, 100), BorderSide.None, Color.Transparent);
            pageImageBrick.Alignment = BrickAlignment.Far;

            // Display the PageInfoBrick containing date-time information. Date-time information is displayed
            // in the left part of the MarginalHeader section using the FullDateTimePattern.
            //{0:F}
            pageInfoBrickFrom      = brickGraphics.DrawPageInfo(PageInfo.None, ":من", Color.Black, new Rectangle(180, 110, 60, 80), BorderSide.None);
            pageInfoBrickFrom.Font = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickFrom      = brickGraphics.DrawPageInfo(PageInfo.None, d.dateFrom, Color.Black, new Rectangle(40, 110, 140, 80), BorderSide.None);

            pageInfoBrickFrom.Alignment = BrickAlignment.Near;
            pageInfoBrickFrom.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickTo             = brickGraphics.DrawPageInfo(PageInfo.None, ":الي", Color.Black, new Rectangle(180, 130, 60, 80), BorderSide.None);
            pageInfoBrickTo.Font        = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickTo             = brickGraphics.DrawPageInfo(PageInfo.None, d.dateTo, Color.Black, new Rectangle(40, 130, 140, 80), BorderSide.None);

            pageInfoBrickTo.Alignment = BrickAlignment.Near;
            pageInfoBrickTo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            BrickGraphics brickGraphics1 = e.Graph;

            pageInfo           = brickGraphics1.DrawPageInfo(PageInfo.None, d.delegateName, Color.Black, new Rectangle(525, 110, 180, 70), BorderSide.None);
            pageInfo.Alignment = BrickAlignment.Near;
            pageInfo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            BrickGraphics brickGraphics3 = e.Graph;

            pageInfo1           = brickGraphics3.DrawPageInfo(PageInfo.None, d.company, Color.Black, new Rectangle(528, 130, 180, 70), BorderSide.None);
            pageInfo1.Alignment = BrickAlignment.Near;
            pageInfo1.Font      = new Font("Tahoma", 10, FontStyle.Bold);

            if (d.company_profit_list != null)
            {
                pageInfoBrickTo      = brickGraphics.DrawPageInfo(PageInfo.None, "الشركة", Color.Black, new Rectangle(525, 110, 100, 80), BorderSide.None);
                pageInfoBrickTo.Font = new Font("Tahoma", 10, FontStyle.Bold);
                pageInfoBrickTo      = brickGraphics.DrawPageInfo(PageInfo.None, "قيمة ربح المندوب", Color.Black, new Rectangle(528, 130, 150, 80), BorderSide.None);

                pageInfoBrickTo.Alignment = BrickAlignment.Far;
                pageInfoBrickTo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
                int           y = 130;
                PageInfoBrick pageInfoBrick3;
                foreach (company_profit item in d.company_profit_list)
                {
                    y += 20;
                    pageInfoBrick3      = brickGraphics.DrawPageInfo(PageInfo.None, item.companyName, Color.Black, new Rectangle(725, y, 140, 80), BorderSide.None);
                    pageInfoBrick3.Font = new Font("Tahoma", 10, FontStyle.Regular);
                    pageInfoBrick3      = brickGraphics.DrawPageInfo(PageInfo.None, item.delegateProfit, Color.Black, new Rectangle(528, y, 140, 80), BorderSide.None);

                    pageInfoBrick3.Alignment = BrickAlignment.Far;
                    pageInfoBrick3.Font      = new Font("Tahoma", 10, FontStyle.Regular);
                }
                pageInfoBrick3 = brickGraphics.DrawPageInfo(PageInfo.None, d.delegateProfit + ":اجمالي ربح المندوب ", Color.Black, new Rectangle(685, y + 40, 230, 80), BorderSide.None);

                pageInfoBrick3.Alignment = BrickAlignment.Far;
                pageInfoBrick3.Font      = new Font("Tahoma", 11, FontStyle.Bold);
            }

            // Declare text strings.
            string devexpress = title;
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics2 = e.Graph;

            brickGraphics2.BackColor = Color.White;
            brickGraphics2.Font      = new Font("Times New Roman", 14, FontStyle.Bold);

            // Display the DevExpress text string.
            SizeF size = brickGraphics2.MeasureString(devexpress);

            pageInfoBrick           = brickGraphics2.DrawPageInfo(PageInfo.None, devexpress, Color.Black, new RectangleF(new PointF(320, 50), size), BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Center;

            if (branchName != "")
            {
                SizeF sizea = brickGraphics2.MeasureString(branchName);
                pageInfoBrick           = brickGraphics2.DrawPageInfo(PageInfo.None, branchName, Color.Black, new RectangleF(new PointF(370, 70), size), BorderSide.None);
                pageInfoBrick.Alignment = BrickAlignment.Center;
            }
            e.Graph.PrintingSystem.Document.PrintingSystem.PageMargins.Bottom = 0;
        }
Exemplo n.º 13
0
        private void PrintableComponentLink_CreateReportHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e)
        {
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics = e.Graph;

            brickGraphics.BackColor = Color.White;
            brickGraphics.Font      = new Font("Neo Sans Arabic", 10);

            // Declare bricks.
            PageInfoBrick  pageInfoBrickFrom;
            PageInfoBrick  pageInfoBrickTo;
            PageInfoBrick  pageInfoBrick;
            PageInfoBrick  pageInfo;
            PageInfoBrick  pageInfo1;
            PageImageBrick pageImageBrick;

            // Define the image to display.
            Image pageImage = TaxesSystem.Properties.Resources.logo_option2;

            // Display the PageImageBrick containing the DevExpress logo.
            pageImageBrick           = brickGraphics.DrawPageImage(pageImage, new Rectangle(10, 0, 150, 150), BorderSide.None, Color.Transparent);
            pageImageBrick.Alignment = BrickAlignment.Far;

            // Display the PageInfoBrick containing date-time information. Date-time information is displayed
            // in the left part of the MarginalHeader section using the FullDateTimePattern.
            //{0:F}
            pageInfoBrickFrom      = brickGraphics.DrawPageInfo(PageInfo.None, ":العميل", Color.Black, new Rectangle(180, 160, 60, 80), BorderSide.None);
            pageInfoBrickFrom.Font = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickFrom      = brickGraphics.DrawPageInfo(PageInfo.None, d.dateFrom, Color.Black, new Rectangle(40, 160, 120, 80), BorderSide.None);

            pageInfoBrickFrom.Alignment = BrickAlignment.Near;
            pageInfoBrickFrom.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickTo             = brickGraphics.DrawPageInfo(PageInfo.None, ":تلفون العميل", Color.Black, new Rectangle(180, 180, 160, 80), BorderSide.None);
            pageInfoBrickTo.Font        = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickTo             = brickGraphics.DrawPageInfo(PageInfo.None, d.dateTo, Color.Black, new Rectangle(40, 180, 120, 80), BorderSide.None);

            pageInfoBrickTo.Alignment = BrickAlignment.Far;
            pageInfoBrickTo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            BrickGraphics brickGraphics1 = e.Graph;

            pageInfo           = brickGraphics1.DrawPageInfo(PageInfo.None, d.dateFrom, Color.Black, new Rectangle(825, 160, 120, 70), BorderSide.None);
            pageInfo.Alignment = BrickAlignment.Near;
            pageInfo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            BrickGraphics brickGraphics3 = e.Graph;

            pageInfo1           = brickGraphics3.DrawPageInfo(PageInfo.None, d.dateTo, Color.Black, new Rectangle(828, 180, 120, 70), BorderSide.None);
            pageInfo1.Alignment = BrickAlignment.Near;
            pageInfo1.Font      = new Font("Tahoma", 10, FontStyle.Bold);

            pageInfoBrickTo      = brickGraphics.DrawPageInfo(PageInfo.None, ":تاريخ الاسترجاع", Color.Black, new Rectangle(825, 240, 100, 80), BorderSide.None);
            pageInfoBrickTo.Font = new Font("Tahoma", 10, FontStyle.Bold);
            pageInfoBrickTo      = brickGraphics.DrawPageInfo(PageInfo.None, ":سبب الاسترجاع", Color.Black, new Rectangle(628, 240, 150, 80), BorderSide.None);

            pageInfoBrickTo.Alignment = BrickAlignment.Far;
            pageInfoBrickTo.Font      = new Font("Tahoma", 10, FontStyle.Bold);
            int           y = 240;
            PageInfoBrick pageInfoBrick3;

            pageInfoBrick3      = brickGraphics.DrawPageInfo(PageInfo.None, d.delegateName, Color.Black, new Rectangle(825, y, 120, 80), BorderSide.None);
            pageInfoBrick3.Font = new Font("Tahoma", 10, FontStyle.Regular);
            pageInfoBrick3      = brickGraphics.DrawPageInfo(PageInfo.None, d.delegateProfit, Color.Black, new Rectangle(628, y, 150, 80), BorderSide.None);

            pageInfoBrick3.Alignment = BrickAlignment.Far;
            pageInfoBrick3.Font      = new Font("Tahoma", 10, FontStyle.Regular);



            // Declare text strings.
            string devexpress = "أذن مرتجع";
            // Specify required settings for the brick graphics.
            BrickGraphics brickGraphics2 = e.Graph;

            brickGraphics2.BackColor = Color.White;
            brickGraphics2.Font      = new Font("Tahoma", 14, FontStyle.Bold);

            // Display the DevExpress text string.
            SizeF size = brickGraphics2.MeasureString(devexpress);

            pageInfoBrick           = brickGraphics2.DrawPageInfo(PageInfo.None, devexpress, Color.Black, new RectangleF(new PointF(420, 50), size), BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Center;

            size                    = brickGraphics2.MeasureString(ReturnPermissionNum.ToString());
            pageInfoBrick           = brickGraphics2.DrawPageInfo(PageInfo.None, ReturnPermissionNum.ToString(), Color.Black, new RectangleF(new PointF(480, 80), size), BorderSide.None);
            pageInfoBrick.Alignment = BrickAlignment.Center;
        }
Exemplo n.º 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            BrickGraphics     gr  = printingSystem1.Graph;
            BrickStringFormat bsf = new BrickStringFormat(StringAlignment.Near, StringAlignment.Center);

            gr.StringFormat = bsf;
            gr.BorderColor  = SystemColors.ControlDark;

            // Declare bricks.
            ImageBrick     imagebrick;
            TextBrick      textbrick;
            CheckBoxBrick  checkbrick;
            Brick          brick;
            PageInfoBrick  pageinfobr;
            PageImageBrick pageimagebr;

            // Declare text strings.
            string[] rows = { "Species No:", "Length (cm):", "Category:", "Common Name:", "Species Name:" },
            desc = { "90070", "30", "Angelfish", "Blue Angelfish", "Pomacanthus nauarchus" };

            string note = "Habitat is around boulders, caves, coral ledges and crevices in shallow waters. " +
                          "Swims alone or in groups. Its color changes dramatically from juvenile to adult. The mature " +
                          "adult fish can startle divers by producing a powerful drumming or thumping sound intended " +
                          "to warn off predators. Edibility is good. Range is the entire Indo-Pacific region.",
                   devexpress = "XtraPrintingSystem by Developer Express Inc.";

            // Define the images to display.
            Image img = Image.FromFile(@"..\..\angelfish.png"), pageimage = Image.FromFile(@"..\..\logo.png");

            printingSystem1.PageSettings.Landscape = false;

            printingSystem1.Begin();

            // Detail section creation.
            gr.Modifier = BrickModifier.Detail;

            // Start creation of a non-separable group of bricks.
            gr.BeginUnionRect();

            // Display the image.
            imagebrick             = gr.DrawImage(img, new RectangleF(0, 0, 250, 150), BorderSide.All, Color.Transparent);
            imagebrick.Hint        = "Blue Angelfish";
            textbrick              = gr.DrawString("1", Color.Blue, new RectangleF(5, 5, 30, 15), BorderSide.All);
            textbrick.StringFormat = textbrick.StringFormat.ChangeAlignment(StringAlignment.Center);

            // Display a checkbox.
            checkbrick = gr.DrawCheckBox(new RectangleF(5, 145, 10, 10), BorderSide.All, Color.White, true);

            // Create a set of bricks, representing a column with species names.
            gr.BackColor = Color.FromArgb(153, 204, 255);
            gr.Font      = new Font("Arial", 10, FontStyle.Italic | FontStyle.Bold | FontStyle.Underline);
            for (int i = 0; i < 5; i++)
            {
                // Draw a VisualBrick representing borders for the following TextBrick.
                brick = gr.DrawRect(new RectangleF(256, 32 * i, 120, 32), BorderSide.All,
                                    Color.Transparent, Color.Empty);

                // Draw the TextBrick with species names.
                textbrick = gr.DrawString(rows[i], Color.Black, new RectangleF(258, 32 * i + 2, 116, 28),
                                          BorderSide.All);
            }

            // Create a set of bricks representing a column with the species characteristics.
            gr.Font      = new Font("Arial", 11, FontStyle.Bold);
            gr.BackColor = Color.White;
            for (int i = 0; i < 5; i++)
            {
                brick = gr.DrawRect(new RectangleF(376, 32 * i, gr.ClientPageSize.Width - 376, 32),
                                    BorderSide.All,
                                    Color.Transparent, gr.BorderColor);

                // Draw a TextBrick with species characteristics.
                textbrick = gr.DrawString(desc[i], Color.Indigo, new RectangleF(378, 32 * i + 2,
                                                                                gr.ClientPageSize.Width - 380, 28),
                                          BorderSide.All);

                // For text bricks containing numeric data, set text alignment to Far.
                if (i < 2)
                {
                    textbrick.StringFormat = textbrick.StringFormat.ChangeAlignment(StringAlignment.Far);
                }
            }

            // Drawing the TextBrick with notes.
            gr.Font      = new Font("Arial", 8);
            gr.BackColor = Color.Cornsilk;
            textbrick    = gr.DrawString(note, Color.Black, new RectangleF(new PointF(0, 160), new
                                                                           SizeF(gr.ClientPageSize.Width, 40)), BorderSide.All);
            textbrick.StringFormat = textbrick.StringFormat.ChangeLineAlignment(StringAlignment.Near);
            textbrick.Hint         = note;

            // Finish the creation of a non-separable group of bricks.
            gr.EndUnionRect();

            // Create a MarginalHeader section.
            gr.Modifier = BrickModifier.MarginalHeader;
            RectangleF r = RectangleF.Empty;

            r.Height     = 20;
            gr.BackColor = Color.White;

            // Display the DevExpress text string.
            SizeF sz = gr.MeasureString(devexpress);

            pageinfobr = gr.DrawPageInfo(PageInfo.None, devexpress, Color.Black, new RectangleF(new
                                                                                                PointF(343 - (sz.Width - pageimage.Width) / 2, pageimage.Height + 3), sz), BorderSide.None);
            pageinfobr.Alignment = BrickAlignment.Center;

            // Display the PageImageBrick containing the Developer Express logo.
            pageimagebr = gr.DrawPageImage(pageimage, new RectangleF(343, 0, pageimage.Width, pageimage.Height),
                                           BorderSide.None, Color.Transparent);
            pageimagebr.Alignment = BrickAlignment.Center;

            // Display the PageInfoBrick containing date-time information. Date-time information is displayed
            // in the left part of the MarginalHeader section using the FullDateTimePattern.
            pageinfobr           = gr.DrawPageInfo(PageInfo.DateTime, "{0:F}", Color.Black, r, BorderSide.None);
            pageinfobr.Alignment = BrickAlignment.Near;

            // Display the PageInfoBrick containing the page number among total pages. The page number
            // is displayed in the right part of the MarginalHeader section.
            pageinfobr = gr.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, r,
                                         BorderSide.None);
            pageinfobr.Alignment = BrickAlignment.Far;

            printingSystem1.End();
            printingSystem1.PreviewFormEx.Show();
        }