Пример #1
0
        /// <summary>method write interpretation reference table to document grid, if it is needed
        /// </summary>
        /// <param name="reportData">report XML data object</param>
        private void WriteInterpretationRefTable(CysticFibrosisReportData reportData)
        {
            if (reportData.IsInterpretationRefTableVisible)
            {
                int    i, j;
                string cellText;
                double fontSize = m_FontSize - 0.5;

                IEnumerable <XElement> colHeaders = reportData.InterpretationRefTableColHeaders;

                int  colCount = colHeaders.Count();
                int  rowCount = reportData.InterpretationRefTableRowsCount + 1;
                Grid grid     = XPSHelper.GetGridWithEqualColumns(rowCount, colCount, 2.0 * m_LeftMargin, m_TopMargin);

                WriteSimpleSection(reportData.InterpretationRefTableHeaderText, fontSize);
                for (j = 0; j < colCount; j++)
                {
                    XPSHelper.WriteTextBlockToGrid(colHeaders.ElementAt(j).Value, grid, 0, j, HorizontalAlignment.Left, VerticalAlignment.Top, null, fontSize, null, FontWeights.Bold);
                }
                for (i = 1; i < rowCount; i++)
                {
                    for (j = 0; j < colCount; j++)
                    {
                        cellText = reportData.GetInterpretationRefTableCellText(i - 1, j);
                        XPSHelper.WriteTextBlockToGrid(cellText, grid, i, j, HorizontalAlignment.Left, VerticalAlignment.Top, new Thickness(0, -2, 0, 0), fontSize);
                    }
                }
                m_ReportDocument.WriteRowContent(grid);
            }
        }
Пример #2
0
 /// <summary>method add OBX segments collection for interpretation reference table section
 /// </summary>
 private void AddInterpretationRefTableObxSegments()
 {
     AddObxSegmentsForSection(m_Data.InterpretationRefTableHeaderText);
     InterpretationRefTableTitleObxSegment();
     for (int i = 0; i < m_Data.InterpretationRefTableRowsCount; i++)
     {
         StringBuilder text = new StringBuilder();
         for (int j = 0; j < m_Data.InterpretationRefTableColsCount; j++)
         {
             if (j == 1)
             {
                 text.Append(": ");
             }
             if (j > 1)
             {
                 text.Append(", ");
             }
             text.Append(m_Data.GetInterpretationRefTableCellText(i, j));
         }
         AddObxSegment(text.ToString());
     }
 }