コード例 #1
0
            public override NDocumentBlock CreateDocument()
            {
                NDocumentBlock document = base.CreateDocument();

                // Create a simple 2x2 table
                NSection section = document.Sections[0];
                NTable   table   = new NTable(2, 2);

                section.Blocks.Add(table);

                for (int row = 0, i = 1; row < table.Rows.Count; row++)
                {
                    for (int col = 0; col < table.Columns.Count; col++, i++)
                    {
                        InitCell(table.Rows[row].Cells[col], "Cell " + i.ToString());
                    }
                }

                // Create a 3x3 table with rowspans and colspans
                table = new NTable(4, 3);
                section.Blocks.Add(table);
                InitCell(table.Rows[0].Cells[0], 2, 1, "Cell 1 (2 rows)");
                InitCell(table.Rows[0].Cells[1], "Cell 2");
                InitCell(table.Rows[0].Cells[2], "Cell 3");
                InitCell(table.Rows[1].Cells[1], 1, 2, "Cell 4 (2 cols)");
                InitCell(table.Rows[2].Cells[0], "Cell 5");
                InitCell(table.Rows[2].Cells[1], 2, 2, "Cell 6 (2 rows x 2 cols)");
                InitCell(table.Rows[3].Cells[0], "Cell 7");

                return(document);
            }
コード例 #2
0
        private NTable CreateTable()
        {
            NTable table = new NTable();

            int rowCount = 3;
            int colCount = 3;

            // first create the columns
            for (int i = 0; i < colCount; i++)
            {
                table.Columns.Add(new NTableColumn());
            }

            // then add rows with cells count matching the number of columns
            for (int row = 0; row < rowCount; row++)
            {
                NTableRow tableRow = new NTableRow();
                table.Rows.Add(tableRow);

                for (int col = 0; col < colCount; col++)
                {
                    NTableCell tableCell = new NTableCell();
                    tableRow.Cells.Add(tableCell);
                    tableCell.Margins = new NMargins(4);

                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);
                    tableCell.BorderThickness = new NMargins(1);

                    NParagraph paragraph = new NParagraph("This is table cell [" + row.ToString() + ", " + col.ToString() + "]");
                    tableCell.Blocks.Add(paragraph);
                }
            }

            return(table);
        }
コード例 #3
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table Master Cells Example", "This example shows how to programmatically create and add master cells.", 1));

            // first create the table
            NTable table = new NTable(5, 5);

            table.AllowSpacingBetweenCells = false;

            for (int row = 0; row < table.Rows.Count; row++)
            {
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    NParagraph paragraph = new NParagraph("Normal Cell");

                    NTableCell tableCell = table.Rows[row].Cells[col];
                    tableCell.BorderThickness = new Nov.Graphics.NMargins(1);
                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);

                    // by default cells contain a single paragraph
                    tableCell.Blocks.Clear();
                    tableCell.Blocks.Add(paragraph);
                }
            }

            // set cell [0, 2] to be column master
            NTableCell colMasterCell = table.Rows[0].Cells[2];

            colMasterCell.ColSpan        = 2;
            colMasterCell.BackgroundFill = new NColorFill(ENNamedColor.LightSkyBlue);
            colMasterCell.Blocks.Clear();
            colMasterCell.Blocks.Add(new NParagraph("Column Master Cell"));

            // set cell [1, 0] to be row master
            NTableCell rowMasterCell = table.Rows[1].Cells[0];

            rowMasterCell.RowSpan        = 2;
            rowMasterCell.BackgroundFill = new NColorFill(ENNamedColor.LightSteelBlue);
            rowMasterCell.Blocks.Clear();
            rowMasterCell.Blocks.Add(new NParagraph("Row Master Cell"));

            // set cell [2, 2] to be column and row master
            NTableCell rowColMasterCell = table.Rows[2].Cells[2];

            rowColMasterCell.ColSpan        = 2;
            rowColMasterCell.RowSpan        = 2;
            rowColMasterCell.BackgroundFill = new NColorFill(ENNamedColor.MediumTurquoise);
            rowColMasterCell.Blocks.Clear();
            rowColMasterCell.Blocks.Add(new NParagraph("Row\\Col Master Cell"));

            section.Blocks.Add(table);
        }
コード例 #4
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table Cell Orientation Example", "This example shows how to programmatically modify the orientation of cells.", 1));

            // first create the table
            NTable table = new NTable(5, 5);

            table.AllowSpacingBetweenCells = false;

            for (int row = 0; row < table.Rows.Count; row++)
            {
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    NParagraph paragraph = new NParagraph("Normal Cell");

                    NTableCell tableCell = table.Rows[row].Cells[col];
                    tableCell.BorderThickness = new Nov.Graphics.NMargins(1);
                    tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);

                    // by default cells contain a single paragraph
                    tableCell.Blocks.Clear();
                    tableCell.Blocks.Add(paragraph);
                }
            }

            // set cell [1, 0] to be row master
            NTableCell leftToRightCell = table.Rows[1].Cells[0];

            leftToRightCell.RowSpan        = int.MaxValue;
            leftToRightCell.BackgroundFill = new NColorFill(ENNamedColor.LightSteelBlue);
            leftToRightCell.Blocks.Clear();
            leftToRightCell.Blocks.Add(new NParagraph("Cell With Left to Right Orientation"));
            leftToRightCell.TextDirection       = ENTableCellTextDirection.LeftToRight;
            leftToRightCell.HorizontalAlignment = ENAlign.Center;
            leftToRightCell.VerticalAlignment   = ENVAlign.Center;

            // set cell [1, 0] to be row master
            NTableCell rightToLeftCell = table.Rows[1].Cells[table.Columns.Count - 1];

            rightToLeftCell.RowSpan        = int.MaxValue;
            rightToLeftCell.BackgroundFill = new NColorFill(ENNamedColor.LightGreen);
            rightToLeftCell.Blocks.Clear();
            rightToLeftCell.Blocks.Add(new NParagraph("Cell With Right to Left Orientation"));
            rightToLeftCell.TextDirection       = ENTableCellTextDirection.RightToLeft;
            rightToLeftCell.HorizontalAlignment = ENAlign.Center;
            rightToLeftCell.VerticalAlignment   = ENVAlign.Center;

            section.Blocks.Add(table);
        }
コード例 #5
0
    public TaskSolution Solve(DiffMethod method, double a, double b, int n)
    {
        TablesManager manager = new TablesManager();

        t0Table    = manager.T0Table;
        mTable     = manager.MTable;
        nTable     = manager.NTable;
        sigmaTable = manager.SigmaTable;

        DiffEquationSys deSys = null;

        switch (method)
        {
        case DiffMethod.RungeKutta:
            deSys = new RungeKuttaDiffEquationSys(new DiffEquationSys.SeveralArgFun[]
            {
                (x, y) => ((y[1] - (Rk + Rp(y[0])) * y[0]) / Lk),
                (x, y) => (-y[0] / Ck)
            });
            break;

        case DiffMethod.ImplTrap:
            deSys = new ImplTrapDiffEquationSys(new DiffEquationSys.SeveralArgFun[]
            {
                (x, y) => ((y[1] - (Rk + Rp(y[0])) * y[0]) / Lk),
                (x, y) => (-y[0] / Ck)
            });
            break;
        }

        DiffEquationSolution[] sysSolution = deSys.FindSolution(a, b, new double[] { I0, Uc0 }, n);
        DiffEquationSolution   rpSolution  = new DiffEquationSolution(a, b, n);

        for (int i = 0; i <= n; i++)
        {
            rpSolution.Y[i] = Rp(sysSolution[0].Y[i]);
        }
        DiffEquationSolution ucpSolution = new DiffEquationSolution(a, b, n);

        for (int i = 0; i <= n; i++)
        {
            ucpSolution.Y[i] = rpSolution.Y[i] * sysSolution[0].Y[i];
        }

        TaskSolution taskSolution;

        taskSolution.I   = sysSolution[0];
        taskSolution.Uc  = sysSolution[1];
        taskSolution.Rp  = rpSolution;
        taskSolution.Ucp = ucpSolution;

        return(taskSolution);
    }
コード例 #6
0
        protected override void PopulateRichText()
        {
            NDocumentBlock documentBlock = m_RichText.Content;

            documentBlock.Layout = ENTextLayout.Print;

            NSection section = new NSection();

            documentBlock.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Barcode Widget Inlines",
                                                   "Nevron Open Vision lets you easily insert barcodes in text documents as widget inlines.", 1));

            // Create a table
            NTable table = new NTable(2, 2);

            section.Blocks.Add(table);

            // Create a linear barcode
            NLinearBarcode linearBarcode = new NLinearBarcode(ENLinearBarcodeSymbology.EAN13, "0123456789012");
            NWidgetInline  widgetInline  = new NWidgetInline(linearBarcode);

            // Create a paragraph to host the linear barcode widget inline
            NTableCell cell = table.Rows[0].Cells[0];

            cell.HorizontalAlignment = ENAlign.Center;
            NParagraph paragraph = (NParagraph)cell.Blocks[0];

            paragraph.Inlines.Add(widgetInline);

            // Create a paragraph to the right with some text
            cell      = table.Rows[0].Cells[1];
            paragraph = (NParagraph)cell.Blocks[0];
            paragraph.Inlines.Add(new NTextInline("The linear barcode to the left uses the EAN13 symbology."));

            // Create a QR code widget inline
            NMatrixBarcode qrCode = new NMatrixBarcode(ENMatrixBarcodeSymbology.QrCode, "https://www.nevron.com");

            widgetInline = new NWidgetInline(qrCode);

            // Create a paragraph to host the QR code widget inline
            cell = table.Rows[1].Cells[0];
            cell.HorizontalAlignment = ENAlign.Center;
            paragraph = (NParagraph)cell.Blocks[0];
            paragraph.Inlines.Add(widgetInline);

            // Create a paragraph to the right with some text
            cell      = table.Rows[1].Cells[1];
            paragraph = (NParagraph)cell.Blocks[0];
            paragraph.Inlines.Add(new NTextInline("The QR code to the left contains a link to "));
            paragraph.Inlines.Add(new NHyperlinkInline("https://www.nevron.com", "https://www.nevron.com"));
            paragraph.Inlines.Add(new NTextInline("."));
        }
コード例 #7
0
        private NWidget CreateRTFDemo()
        {
            NStackPanel stack = new NStackPanel();

            stack.FillMode = ENStackFillMode.Last;
            stack.FitMode  = ENStackFitMode.Last;

            NButton setButton = new NButton("Set Clipboard RTF");

            setButton.Click += new Function <NEventArgs>(OnSetRTFButtonClick);

            NButton getButton = new NButton("Get Clipboard RTF");

            getButton.Click += new Function <NEventArgs>(OnGetRTFButtonClick);

            NPairBox pairBox = new NPairBox(setButton, getButton);

            pairBox.HorizontalPlacement = ENHorizontalPlacement.Left;
            pairBox.Spacing             = NDesign.HorizontalSpacing;
            stack.Add(pairBox);

            // Create a rich text view and some content
            m_RichText = new NRichTextView();
            m_RichText.PreferredSize = new NSize(400, 300);

            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            NTable table = new NTable(2, 2);

            table.AllowSpacingBetweenCells = false;

            section.Blocks.Add(table);
            for (int i = 0; i < 4; i++)
            {
                NTableCell cell = table.Rows[i / 2].Cells[i % 2];
                cell.Border          = NBorder.CreateFilledBorder(NColor.Black);
                cell.BorderThickness = new NMargins(1);
                NParagraph paragraph = (NParagraph)cell.Blocks[0];
                paragraph.Inlines.Add(new NTextInline("Cell " + (i + 1).ToString(CultureInfo.InvariantCulture)));
            }

            stack.Add(m_RichText);
            return(stack);
        }
コード例 #8
0
        /// <summary>
        ///
        /// </summary>
        protected override void PopulateRichText()
        {
            m_Books            = new NBookInfoList();
            m_CurrentBookIndex = 0;

            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);
            m_RichText.Document.StyleSheets.Add(CreateShoppingCartStyleSheet());

            {
                NTable navigationTable = new NTable(1, 2);

                NTableCell cell0 = navigationTable.Rows[0].Cells[0];

                NButton showPrevBookButton = new NButton("Show Prev Book");
                showPrevBookButton.Click += new Function <NEventArgs>(OnShowPrevBookButtonClick);

                cell0.Blocks.Clear();
                cell0.Blocks.Add(CreateWidgetParagraph(showPrevBookButton));

                NTableCell cell1 = navigationTable.Rows[0].Cells[1];

                NButton showNextBookButton = new NButton("Show Next Book");
                showNextBookButton.Click += new Function <NEventArgs>(OnShowNextBookButtonClick);

                cell1.Blocks.Clear();
                cell1.Blocks.Add(CreateWidgetParagraph(showNextBookButton));

                section.Blocks.Add(navigationTable);
            }

            m_BookInfoPlaceHolder = new NGroupBlock();
            section.Blocks.Add(m_BookInfoPlaceHolder);

            {
                m_BookInfoPlaceHolder.Blocks.Add(CreateBookContent(m_Books[0]));
            }

            {
                m_ShoppingCartPlaceHolder = new NGroupBlock();
                AddEmptyShoppingCartText();

                section.Blocks.Add(m_ShoppingCartPlaceHolder);
            }
        }
コード例 #9
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);
            m_RichText.Content.Layout = ENTextLayout.Print;

            section.Blocks.Add(GetDescriptionBlock("Page Breaks", "The example shows how to add page break inlines.", 1));

            // paragraphs with different horizontal alignment
            section.Blocks.Add(GetTitleParagraph("Paragraphs can contain explicit page breaks", 2));

            for (int i = 0; i < 23; i++)
            {
                if (i % 10 == 0)
                {
                    section.Blocks.Add(GetParagraphWithPageBreak());
                }
                else
                {
                    section.Blocks.Add(GetParagraphWithoutPageBreak());
                }
            }

            section.Blocks.Add(GetTitleParagraph("Tables can also contain page breaks", 2));

            NTable table = new NTable(3, 3);

            for (int row = 0; row < table.Rows.Count; row++)
            {
                for (int col = 0; col < table.Columns.Count; col++)
                {
                    // by default cells contain a single paragraph
                    table.Rows[row].Cells[col].Blocks.Clear();
                    table.Rows[row].Cells[col].Blocks.Add(GetParagraphWithoutPageBreak());
                }
            }

            table.Rows[1].Cells[1].Blocks.Clear();
            table.Rows[1].Cells[1].Blocks.Add(GetParagraphWithPageBreak());

            section.Blocks.Add(table);
        }
コード例 #10
0
        protected override void PopulateRichText()
        {
            NDocumentBlock documentBlock = m_RichText.Content;
            NSection       section       = new NSection();

            documentBlock.Sections.Add(section);

            // Create the first table
            section.Blocks.Add(new NParagraph("Table with predefined table style:"));
            NTable table1 = CreateTable();

            section.Blocks.Add(table1);

            // Apply a predefined table style
            NRichTextStyle predefinedStyle = documentBlock.Styles.FindStyleByTypeAndId(ENRichTextStyleType.Table, "GridTable2Blue");

            predefinedStyle.Apply(table1);

            // Create the second table
            NParagraph paragraph = new NParagraph("Table with custom table style:");

            paragraph.MarginTop = 30;
            section.Blocks.Add(paragraph);
            NTable table2 = CreateTable();

            section.Blocks.Add(table2);

            // Create a custom table style and apply it
            NTableStyle customStyle = new NTableStyle("CustomTableStyle");

            customStyle.WholeTable            = new NTablePartStyle();
            customStyle.WholeTable.BorderRule = new NBorderRule(ENPredefinedBorderStyle.Solid, NColor.DarkRed, new NMargins(1));
            customStyle.WholeTable.BorderRule.InsideHSides = new NBorderSideRule(ENPredefinedBorderStyle.Solid, NColor.DarkRed, 1);
            customStyle.WholeTable.BorderRule.InsideVSides = new NBorderSideRule(ENPredefinedBorderStyle.Solid, NColor.DarkRed, 1);

            customStyle.FirstRow = new NTablePartStyle();
            customStyle.FirstRow.BackgroundFill       = new NColorFill(NColor.DarkRed);
            customStyle.FirstRow.InlineRule           = new NInlineRule(NColor.White);
            customStyle.FirstRow.InlineRule.FontStyle = ENFontStyle.Bold;

            customStyle.Apply(table2);
        }
コード例 #11
0
        /// <summary>
        /// Creates a table based on the book info
        /// </summary>
        /// <param name="bookInfo"></param>
        /// <returns></returns>
        Nevron.Nov.Text.NBlock CreateBookContent(NBookInfo bookInfo)
        {
            NTable table = new NTable(4, 2);

            // Create the image
            NTableCell imageTableCell = table.Rows[0].Cells[0];

            imageTableCell.RowSpan = int.MaxValue;
            imageTableCell.Blocks.Clear();
            imageTableCell.Blocks.Add(CreateImageParagraph(bookInfo.Image));

            NTableCell titleTableCell = table.Rows[0].Cells[1];

            titleTableCell.Blocks.Clear();
            titleTableCell.Blocks.Add(CreateTitleParagraph(bookInfo.Name));

            NTableCell descriptionTableCell = table.Rows[1].Cells[1];

            descriptionTableCell.Blocks.Clear();
            descriptionTableCell.Blocks.Add(CreateDescriptionParagraph(bookInfo.Description));

            NTableCell authorTableCell = table.Rows[2].Cells[1];

            authorTableCell.Blocks.Clear();
            authorTableCell.Blocks.Add(CreateAuthorParagraph(bookInfo.Author));

            NTableCell addToCartTableCell = table.Rows[3].Cells[1];

            addToCartTableCell.RowSpan = int.MaxValue;
            addToCartTableCell.Blocks.Clear();

            NButton addToCartButton = new NButton("Add To Cart");

            addToCartButton.Click += new Function <NEventArgs>(OnAddTableRow);
            addToCartTableCell.VerticalAlignment = ENVAlign.Bottom;
            addToCartTableCell.Blocks.Add(CreateWidgetParagraph(addToCartButton));

            return(table);
        }
コード例 #12
0
        /// <summary>
        /// Called when a new row must be added to the shopping cart
        /// </summary>
        /// <param name="arg"></param>
        void OnAddTableRow(NEventArgs arg)
        {
            if (m_CartTable == null)
            {
                m_CartTable     = new NTable(1, 5);
                m_CartTable.Tag = "ShoppingCart";
                m_CartTable.AllowSpacingBetweenCells = false;

                m_ShoppingCartPlaceHolder.Blocks.Clear();
                m_ShoppingCartPlaceHolder.Blocks.Add(m_CartTable);

                NTableCell nameCell = m_CartTable.Rows[0].Cells[0];
                nameCell.Blocks.Clear();
                nameCell.Blocks.Add(new NParagraph("Name"));

                NTableCell quantity = m_CartTable.Rows[0].Cells[1];
                quantity.Blocks.Clear();
                quantity.Blocks.Add(new NParagraph("Quantity"));

                NTableCell priceCell = m_CartTable.Rows[0].Cells[2];
                priceCell.Blocks.Clear();
                priceCell.Blocks.Add(new NParagraph("Price"));

                NTableCell totalCell = m_CartTable.Rows[0].Cells[3];
                totalCell.Blocks.Clear();
                totalCell.Blocks.Add(new NParagraph("Total"));

                NTableCell deleteCell = m_CartTable.Rows[0].Cells[4];
                deleteCell.Blocks.Clear();

                AddTotalRow();
            }

            AddBookRow();

            UpdateTotals();
        }
コード例 #13
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table example", "This example shows how to programmatically create and add a table to the text control.", 1));

            NParagraph p = GetTitleParagraph("Table with cell spacing.", 2);

            section.Blocks.Add(p);

            NTable tableWithCellSpacing = CreateTable();

            tableWithCellSpacing.AllowSpacingBetweenCells = true;
            section.Blocks.Add(tableWithCellSpacing);

            section.Blocks.Add(GetTitleParagraph("Table without cell spacing.", 2));

            NTable tableWithoutCellSpacing = CreateTable();

            tableWithoutCellSpacing.AllowSpacingBetweenCells = false;
            section.Blocks.Add(tableWithoutCellSpacing);
        }
コード例 #14
0
        protected override void PopulateRichText()
        {
            {
                NSection headerSection = new NSection();
                m_RichText.Content.Sections.Add(headerSection);

                headerSection.Blocks.Add(CreateTitleParagraph("Welcome to our annual report\nFurther information on Sample Group can be found at:\n www.samplegroup.com"));
                headerSection.Blocks.Add(CreateContentParagraph("Sample Group is a diversified international market infrastructure and capital markets business sitting at the heart of the world’s financial community."));
                headerSection.Blocks.Add(CreateContentParagraph("The Group operates a broad range of international equity, bond and derivatives markets, including Stock Exchange; Europe’s leading fixed income market; and a pan-European equities MTF. Through its platforms, the Group offers international business and investors unrivalled access to Europe’s capital markets."));
                headerSection.Blocks.Add(CreateContentParagraph("Post trade and risk management services are a significant part of the Group’s business operations. In addition to majority ownership of multi-asset global CCP operator, Sunset Group, the Group operates G&B, a clearing house; Monte Span, the European settlement business; and AutoSettle, the Group’s newly established central securities depository based in Luxembourg. The Group is a global leader in indexing and analytic solutions. The Group also provides customers with an extensive range of real time and reference data products. The Group is a leading developer of high performance trading platforms and capital markets software for customers around the world, through MillenniumIT. Since December 2014, the Group has owned Bonita Investments, an investment management business."));
                headerSection.Blocks.Add(CreateContentParagraph("Headquartered in London, with significant operations in North America, China and Russia, the Group employs approximately 6000 people"));
            }

            {
                NSection financialHighlightsSection = new NSection();
                financialHighlightsSection.BreakType = ENSectionBreakType.NextPage;
                m_RichText.Content.Sections.Add(financialHighlightsSection);
                financialHighlightsSection.Blocks.Add(CreateTitleParagraph("Financial highlights"));
                financialHighlightsSection.Blocks.Add(CreateContentParagraph("The following charts provide insight to the group's total income, operating profit, and earnings per share for the years since 2008."));

                NSize chartSize = new NSize(300, 200);
                {
                    NTable table = new NTable();
                    table.AllowSpacingBetweenCells = false;
                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());
                    financialHighlightsSection.Blocks.Add(table);

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);
                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted total income", new double[] { 674.9, 814.8, 852.9, 1, 213.1, 1, 043.9, 1, 096.4, 1, 381.1 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }

                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted operating profit", new double[] { 341.1, 441.9, 430.2, 514.7, 417.5, 479.9, 558.0 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);
                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Operating profit", new double[] { 283.0, 358.5, 348.4, 353.1, 242.1, 329.4, 346.0 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }

                        {
                            NTableCell tableCell = new NTableCell();
                            tableCell.Blocks.Add(CreateSampleBarChart(chartSize, "Adjusted earnings per share", new double[] { 67.9, 92.6, 97.0, 98.6, 75.6, 96.5, 103.3 }, new string[] { "2008", "2009", "2010", "2011", "2012", "2013", "2014" }));
                            tableRow.Cells.Add(tableCell);
                        }
                    }
                }
            }

            {
                NSection operationalHighlights = new NSection();
                operationalHighlights.ColumnCount = 2;
                operationalHighlights.BreakType   = ENSectionBreakType.NextPage;
                operationalHighlights.Blocks.Add(CreateTitleParagraph("Operational highlights"));
                m_RichText.Content.Sections.Add(operationalHighlights);

                operationalHighlights.Blocks.Add(CreateContentParagraph("The Group is delivering on its strategy, leveraging its range of products and services and further diversifying its offering through new product development and strategic investments. A few examples of the progress being made are highlighted below: "));

                operationalHighlights.Blocks.Add(CreateContentParagraph("Capital Markets"));

                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Revenues for calendar year 2014 increased by 12 per cent to £333.2 million (2013: £296.8 million). Primary Markets saw a seven year high in new issue activity with 219 new companies admitted, including AA, the largest UK capital raising IPO of the year");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("UK cash equity average daily value traded increased 15 per cent and average daily number of trades in Italy increased 16 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Average daily value traded on Turquoise, our European cash equities MTF, increased 42 per cent to €3.7 billion per day and share of European trading increased to over 9 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("In Fixed Income, MTS cash and BondVision value traded increased by 32 per cent, while MTS Repo value traded increased by 3 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                }
                operationalHighlights.Blocks.Add(CreateContentParagraph("Post Trade Services"));
                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Revenues for calendar year 2014 increased by 3 per cent in constant currency terms. In sterling terms revenues declined by 2 per cent to £96.5 million");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group  cleared 69.7 million equity trades, up 16 per cent and 39.0 million derivative contracts up 20 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group is the largest CSD entering the first wave of TARGET2-Securities from June 2015. Successful testing with the European Central Bank finished in December 2014. In addition, Our Group moved settlement of contracts executed on the Italian market from T+3 to T+2 in October 2014");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                }

                operationalHighlights.Blocks.Add(CreateContentParagraph("Post Trade Services 2"));

                {
                    NBulletList bulletList = new NBulletList(ENBulletListTemplateType.Bullet);
                    m_RichText.Content.BulletLists.Add(bulletList);

                    {
                        NParagraph par = CreateContentParagraph("Adjusted income for the calendar year 2014 was £389.4 million, up 24 per cent on a pro forma constant currency basis. LCH.Clearnet received EMIR reauthorisation for the UK and France businesses — SwapClear, the world’s leading interest rate swap clearing service, cleared $642 trillion notional, up 26 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Compression services at SwapClear reduced level of notional outstanding, from $426 trillion to $362 trillion");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    {
                        NParagraph par = CreateContentParagraph("Our Group was granted clearing house recognition in Canada and Australia");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                    {
                        NParagraph par = CreateContentParagraph("Clearing of commodities for the London Metal Exchange ceased in September 2014 as expected");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }
                    {
                        NParagraph par = CreateContentParagraph("RepoClear, one of Europe’s largest fixed income clearers, cleared €73.4 trillion in nominal value, up 1 per cent");
                        par.SetBulletList(bulletList, 0);
                        operationalHighlights.Blocks.Add(par);
                    }

                    operationalHighlights.Blocks.Add(CreateContentParagraph("Group Adjusted Total Income by segment"));

                    NTable table = new NTable();
                    table.Margins = new NMargins(10);
                    table.AllowSpacingBetweenCells = false;
                    operationalHighlights.Blocks.Add(table);

                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());
                    table.Columns.Add(new NTableColumn());

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("2013"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("2014"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Capital Markets"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("249.1"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("333.2"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Post Trade Service"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("94.7"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("129.1"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Information Services "));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("281.0"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("373.0"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Technology Services"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("47.3"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("66.0"));
                        tableRow.Cells.Add(tc3);
                    }

                    {
                        NTableRow tableRow = new NTableRow();
                        table.Rows.Add(tableRow);

                        NTableCell tc1 = CreateTableCellWithBorder();
                        tc1.Blocks.Add(CreateContentParagraph("Other"));
                        tableRow.Cells.Add(tc1);

                        NTableCell tc2 = CreateTableCellWithBorder();
                        tc2.Blocks.Add(CreateContentParagraph("87.2"));
                        tableRow.Cells.Add(tc2);

                        NTableCell tc3 = CreateTableCellWithBorder();
                        tc3.Blocks.Add(CreateContentParagraph("90.4"));
                        tableRow.Cells.Add(tc3);
                    }
                }
            }
        }
コード例 #15
0
        /// <summary>
        ///
        /// </summary>
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            NParagraph paragraph = new NParagraph();

            paragraph.HorizontalAlignment = ENAlign.Center;
            paragraph.Inlines.Add(CreateHeaderText("ACME Corporation"));
            paragraph.Inlines.Add(new NLineBreakInline());
            paragraph.Inlines.Add(CreateNormalText("Monthly Health Report"));

            section.Blocks.Add(paragraph);

            // generate sample data
            double[] sales      = new double[12];
            double[] hours      = new double[12];
            double[] profitloss = new double[12];
            string[] months     = new string[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
            Random   random     = new Random();

            for (int i = 0; i < 12; i++)
            {
                sales[i]      = 50 + random.Next(50);
                hours[i]      = 50 + random.Next(50);
                profitloss[i] = 25 - random.Next(50);
            }

            NTable table = new NTable();

            section.Blocks.Add(table);

            table.Columns.Add(new NTableColumn());
            table.Columns.Add(new NTableColumn());

            {
                NTableRow tableRow = new NTableRow();

                NTableCell tableCell1 = new NTableCell();

                NParagraph par1 = new NParagraph();
                par1.Inlines.Add(CreateHeaderText("Sales New Projects"));
                tableCell1.Blocks.Add(par1);
                tableRow.Cells.Add(tableCell1);

                NTableCell tableCell2 = new NTableCell();
                tableCell2.Blocks.Add(new NParagraph());
                tableRow.Cells.Add(tableCell2);

                table.Rows.Add(tableRow);
            }

            {
                NTableRow tableRow = new NTableRow();

                NTableCell tableCell1 = new NTableCell();

                NParagraph par1 = new NParagraph();
                par1.Inlines.Add(CreateHeaderText("Total Sales: " + GetTotal(sales).ToString()));
                par1.Inlines.Add(new NLineBreakInline());
                par1.Inlines.Add(CreateNormalText("Last Month: " + sales[11].ToString()));
                tableCell1.Blocks.Add(par1);
                tableRow.Cells.Add(tableCell1);

                NTableCell tableCell2 = new NTableCell();
                tableCell2.Blocks.Add(CreateBarChart(true, new NSize(400, 200), "Sales", sales, months));
                tableRow.Cells.Add(tableCell2);

                table.Rows.Add(tableRow);
            }

            {
                NTableRow tableRow = new NTableRow();

                NTableCell tableCell1 = new NTableCell();

                NParagraph par1 = new NParagraph();
                par1.Inlines.Add(CreateHeaderText("Billable Hours: " + GetTotal(hours).ToString()));
                par1.Inlines.Add(new NLineBreakInline());
                par1.Inlines.Add(CreateNormalText("Last Month: " + hours[11].ToString()));
                tableCell1.Blocks.Add(par1);
                tableRow.Cells.Add(tableCell1);

                NTableCell tableCell2 = new NTableCell();
                tableCell2.Blocks.Add(CreateBarChart(false, new NSize(400, 200), "Hours", hours, months));
                tableRow.Cells.Add(tableCell2);

                table.Rows.Add(tableRow);
            }

            {
                NTableRow tableRow = new NTableRow();

                NTableCell tableCell1 = new NTableCell();

                NParagraph par1 = new NParagraph();
                par1.Inlines.Add(CreateHeaderText("Profit / Loss: " + GetTotal(profitloss).ToString()));
                par1.Inlines.Add(new NLineBreakInline());
                par1.Inlines.Add(CreateNormalText("Last Month: " + profitloss[11].ToString()));
                tableCell1.Blocks.Add(par1);
                tableRow.Cells.Add(tableCell1);

                NTableCell tableCell2 = new NTableCell();
                tableCell2.Blocks.Add(CreateBarChart(false, new NSize(400, 200), "Profit / Loss", hours, months));
                tableRow.Cells.Add(tableCell2);

                table.Rows.Add(tableRow);
            }
        }
コード例 #16
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            {
                section.Blocks.Add(GetDescriptionBlock("Table Borders Example", "This examples shows how table borders behave when the table allows or not table cells spacing.", 1));

                // first create the table
                NTable table = CreateTable(2, 3);

                table.AllowSpacingBetweenCells   = true;
                table.TableCellHorizontalSpacing = 3;
                table.TableCellVerticalSpacing   = 3;

                for (int col = 0; col < table.Columns.Count; col++)
                {
                    for (int row = 0; row < table.Rows.Count; row++)
                    {
                        NTableCell cell = table.Rows[row].Cells[col];

                        switch (col % 3)
                        {
                        case 0:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Red);
                            cell.Margins         = new NMargins(3);
                            cell.Padding         = new NMargins(3);
                            cell.BorderThickness = new NMargins(1);
                            break;

                        case 1:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Green);
                            cell.Margins         = new NMargins(5);
                            cell.Padding         = new NMargins(5);
                            cell.BorderThickness = new NMargins(3);
                            break;

                        case 2:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Blue);
                            cell.Margins         = new NMargins(7);
                            cell.Padding         = new NMargins(7);
                            cell.BorderThickness = new NMargins(2);
                            break;
                        }
                    }
                }

                table.Border          = NBorder.CreateFilledBorder(NColor.Red);
                table.BorderThickness = new NMargins(2, 2, 2, 2);

                section.Blocks.Add(table);

                section.Blocks.Add(new NParagraph("This is a 2x3 table, with borders in collapsed table border mode:"));

                // first create the table
                table = CreateTable(2, 3);

                table.AllowSpacingBetweenCells = false;

                for (int col = 0; col < table.Columns.Count; col++)
                {
                    for (int row = 0; row < table.Rows.Count; row++)
                    {
                        NTableCell cell = table.Rows[row].Cells[col];

                        switch (col % 3)
                        {
                        case 0:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Red);
                            cell.Margins         = new NMargins(3);
                            cell.Padding         = new NMargins(3);
                            cell.BorderThickness = new NMargins(1);
                            break;

                        case 1:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Green);
                            cell.Margins         = new NMargins(5);
                            cell.Padding         = new NMargins(5);
                            cell.BorderThickness = new NMargins(3);
                            break;

                        case 2:
                            cell.Border          = NBorder.CreateFilledBorder(NColor.Blue);
                            cell.Margins         = new NMargins(7);
                            cell.Padding         = new NMargins(7);
                            cell.BorderThickness = new NMargins(2);
                            break;
                        }
                    }
                }

                table.Border = NBorder.CreateFilledBorder(NColor.Red);

                section.Blocks.Add(table);
            }
        }
コード例 #17
0
        private NTable CreateTable(int rowCount, int colCount)
        {
            // first create the table
            NTable table = new NTable(rowCount, colCount);

            table.AllowSpacingBetweenCells   = true;
            table.TableCellHorizontalSpacing = 3;
            table.TableCellVerticalSpacing   = 3;

            for (int col = 0; col < table.Columns.Count; col++)
            {
                // set table column preferred width
                string headerText = string.Empty;
                switch (col)
                {
                case 0:     // Fixed column
                    table.Columns[col].PreferredWidth = new NMultiLength(ENMultiLengthUnit.Dip, 80);
                    headerText = "Fixed [80dips]";
                    break;

                case 1:     // Auto
                    headerText = "Automatic";
                    break;

                case 2:     // Percentage
                    table.Columns[col].PreferredWidth = new NMultiLength(ENMultiLengthUnit.Percentage, 20);
                    headerText = "Percentage [20%]";
                    break;

                case 3:     // Fixed
                    table.Columns[col].PreferredWidth = new NMultiLength(ENMultiLengthUnit.Dip, 160);
                    headerText = "Fixed [160dips]";
                    break;

                case 4:     // Percentage
                    table.Columns[col].PreferredWidth = new NMultiLength(ENMultiLengthUnit.Percentage, 30);
                    headerText = "Percentage [30%]";
                    break;
                }

                for (int row = 0; row < table.Rows.Count; row++)
                {
                    NParagraph paragraph;
                    if (row == 0)
                    {
                        paragraph = new NParagraph(headerText);
                    }
                    else
                    {
                        paragraph = new NParagraph("Cell");
                    }

                    NTableCell cell = table.Rows[row].Cells[col];

                    cell.Blocks.Clear();
                    cell.Blocks.Add(paragraph);
                }
            }

            return(table);
        }
コード例 #18
0
        protected override void PopulateRichText()
        {
            NSection section = new NSection();

            m_RichText.Content.Sections.Add(section);

            section.Blocks.Add(GetDescriptionBlock("Table Column Types Example", "This example shows how to set the table column preferred width.", 1));

            {
                // create the table
                NTable table = new NTable();

                table.AllowSpacingBetweenCells = false;

                int columnCount = 5;
                int rowCount    = 5;

                for (int row = 0; row < rowCount; row++)
                {
                    NTableRow tableRow = new NTableRow();
                    table.Rows.Add(tableRow);

                    for (int col = 0; col < columnCount; col++)
                    {
                        NParagraph paragraph;

                        if (row == 0)
                        {
                            // set table column preferred width
                            string       headerText  = string.Empty;
                            NTableColumn tableColumn = new NTableColumn();

                            if (col % 2 == 0)
                            {
                                tableColumn.BackgroundFill = new NColorFill(NColor.LightGray);
                            }
                            else
                            {
                                tableColumn.BackgroundFill = new NColorFill(NColor.Beige);
                            }

                            switch (col)
                            {
                            case 0:                                     // Fixed column
                                tableColumn.PreferredWidth = new NMultiLength(ENMultiLengthUnit.Dip, 80);
                                headerText = "Fixed [80dips]";
                                break;

                            case 1:                                     // Auto
                                headerText = "Automatic";
                                break;

                            case 2:                                     // Percentage
                                tableColumn.PreferredWidth = new NMultiLength(ENMultiLengthUnit.Percentage, 20);
                                headerText = "Percentage [20%]";
                                break;

                            case 3:                                     // Fixed
                                tableColumn.PreferredWidth = new NMultiLength(ENMultiLengthUnit.Dip, 160);
                                headerText = "Fixed [160dips]";
                                break;

                            case 4:                                     // Percentage
                                tableColumn.PreferredWidth = new NMultiLength(ENMultiLengthUnit.Percentage, 30);
                                headerText = "Percentage [30%]";
                                break;
                            }

                            table.Columns.Add(tableColumn);
                            paragraph = new NParagraph(headerText);
                        }
                        else
                        {
                            paragraph = new NParagraph("Cell");
                        }

                        // by default cells contain a single paragraph
                        NTableCell tableCell = new NTableCell();
                        tableCell.Border          = NBorder.CreateFilledBorder(NColor.Black);
                        tableCell.BorderThickness = new NMargins(1);
                        tableCell.Blocks.Add(paragraph);

                        tableRow.Cells.Add(tableCell);
                    }
                }

                section.Blocks.Add(table);
            }
        }