Exemple #1
0
        /// <summary>method "Result" underlined header to main box grid
        /// </summary>
        /// <param name="grid">main box grid</param>
        /// <param name="colCount">columns count in main box grid</param>
        protected void WriteResultUnderlinedHeader(Grid grid)
        {
            int       colCount = grid.ColumnDefinitions.Count;
            Border    root     = XPSHelper.WriteUnderliningToGridCell(grid, 0, 0, null, 0.5, 0, colCount);
            TextBlock title    = XPSHelper.GetTextBlock(ResultLabel, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(m_LeftMargin + 12, 4, 0, 4), m_FontSize + 2, null, FontWeights.Bold);

            root.Child = title;
        }
        /// <summary>method write block with check box and text block to document grid
        /// </summary>
        /// <param name="baseGrid">block's parent grid</param>
        /// <param name="labelText">label of check box</param>
        /// <param name="stringXMLElementName">XML element name with text block value</param>
        /// <param name="rowNo">parent grid row number of block</param>
        /// <param name="colNo">parent grid column number of block</param>
        private void WriteCheckBoxAndTextBlock(Grid baseGrid, string labelText, string textValue, int rowNo, int colNo)
        {
            //string textValue = (stringXMLElementName != string.Empty ? m_PlacentalPathologyData.Element(stringXMLElementName).Value : string.Empty);
            Grid grid = XPSHelper.GetGrid(new GridLength[] { GridLength.Auto, new GridLength(1, GridUnitType.Star) }, 1, 0.0, new Thickness(0, 0, m_MarginSize * 4, 0));

            XPSHelper.WriteItemToGrid(grid, baseGrid, rowNo, colNo);
            XPSHelper.WriteCheckBox(labelText, (textValue != string.Empty), grid, 0, 0, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(m_MarginSize, m_MarginSize * 2, m_MarginSize, m_MarginSize), m_FontSize, null, FontWeights.Normal);
            XPSHelper.WriteTextBlockToGrid(textValue, grid, 0, 1, HorizontalAlignment.Stretch, VerticalAlignment.Top, new Thickness(m_MarginSize, m_MarginSize * 2, m_MarginSize, 0), m_FontSize);
            XPSHelper.WriteUnderliningToGridCell(grid, 0, 1);
        }
        /// <summary>method write block with label and value to document grid
        /// </summary>
        /// <param name="baseGrid">block's parent grid</param>
        /// <param name="labelText">string value in label part of block</param>
        /// <param name="value">string value in text part of block</param>
        /// <param name="rowNo">parent grid row number of block</param>
        /// <param name="colNo">parent grid column number of block</param>
        /// <param name="addBullet">if true, then bullet added before label part of block</param>
        /// <param name="colSpan">ColSpan parameter of parent grid cell</param>
        private static void WriteLabelAndTextBlock(Grid baseGrid, string labelText, string value, int rowNo, int colNo, bool addBullet = true, int colSpan = 0)
        {
            Grid grid = XPSHelper.GetGrid(new GridLength[] { GridLength.Auto, new GridLength(1, GridUnitType.Star) }, 1);

            XPSHelper.WriteItemToGrid(grid, baseGrid, rowNo, colNo, 0, colSpan);
            string fullLabelText = string.Format("{0}{1}", (addBullet ? string.Format("{0} ", m_Bullet) : ""), labelText);

            XPSHelper.WriteTextBlockToGrid(fullLabelText, grid, 0, 0, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(m_MarginSize, m_MarginSize + 1, m_MarginSize, m_MarginSize - 1), m_FontSize);
            XPSHelper.WriteTextBlockToGrid(value, grid, 0, 1, HorizontalAlignment.Stretch, VerticalAlignment.Top, new Thickness(m_MarginSize, m_MarginSize, m_MarginSize, m_MarginSize), m_FontSize);
            XPSHelper.WriteUnderliningToGridCell(grid, 0, 1);
        }
        /// <summary>method write content to right column of page header
        /// </summary>
        private void WriteRightColumn(Grid grid)
        {
            const int rowIndex = 0;
            const int colIndex = 1;

            Border    root   = XPSHelper.WriteUnderliningToGridCell(grid, rowIndex, colIndex, m_RedishBrush);
            Thickness margin = new Thickness(0, 0, m_HorMargin, m_BottomMargin);
            TextBlock title  = XPSHelper.GetTextBlock(string.Empty, HorizontalAlignment.Right, VerticalAlignment.Top, margin, m_FontSize, m_RedishBrush, FontWeights.Bold);

            root.Child = title;
        }
        /// <summary>method write content to left column of page header
        /// </summary>
        private void WriteLeftColumn(Grid grid)
        {
            const int rowIndex = 0;
            const int colIndex = 0;

            Border    root   = XPSHelper.WriteUnderliningToGridCell(grid, rowIndex, colIndex, m_RedishBrush);
            Thickness margin = new Thickness(m_HorMargin, 0, 0, m_BottomMargin);
            string    text   = string.Format("{0}, {1}", m_Data.GetPatientDisplayName(), m_Data.GetStringValue(ReportHeaderData.ReportNo));
            TextBlock title  = XPSHelper.GetTextBlock(text, HorizontalAlignment.Left, VerticalAlignment.Top, margin, m_FontSize, m_RedishBrush, FontWeights.Bold);

            root.Child = title;
        }
Exemple #6
0
        /// <summary>method write column header to document grid
        /// </summary>
        /// <param name="grid">document grid</param>
        /// <param name="text">column header's text</param>
        /// <param name="colIndex">column index</param>
        /// <param name="fontSize">header's text font size</param>
        /// <param name="colAlign">header's horizontal alignment</param>
        private void WriteColumnHeader(Grid grid, string text, int colIndex, double fontSize, HorizontalAlignment horAlign)
        {
            const int topMargin = 0;
            const int rowIndex  = 1;

            Border     border     = XPSHelper.WriteUnderliningToGridCell(grid, rowIndex, colIndex, m_RedishBrush);
            Thickness  margin     = new Thickness(horAlign == HorizontalAlignment.Left ? m_HorMargin : 0, topMargin, horAlign == HorizontalAlignment.Right ? m_HorMargin : 0, 0);
            FontWeight fontWeight = (colIndex == 2 ? FontWeights.Normal : FontWeights.Bold);
            TextBlock  colHeader  = XPSHelper.GetTextBlock(text, horAlign, VerticalAlignment.Top, margin, fontSize, m_RedishBrush, fontWeight);

            border.Child = colHeader;
        }