Esempio n. 1
0
        /// <summary>method write report's main box custom sections to document grid
        /// </summary>
        protected override int WriteCustomSectionToMainBox()
        {
            const double fontSize   = m_FontSize + 2;
            const double leftMargin = m_LeftMargin + 18;
            const double topMargin  = m_TopMargin + 6;

            int  rowsCount = m_ReportData.ResultRowsCount + 1;
            Grid grid      = XPSHelper.GetGrid(XPSHelper.GetFullWidthGridColWidthArray(new double[] { 0.4, 1.8, 2.5 }, m_LeftMargin), rowsCount);

            grid.Margin = new Thickness(leftMargin, topMargin, 0, 0);

            for (int i = 0; i < rowsCount; i++)
            {
                for (int j = 0; j < ResultColumnsHeaders.GetLength(0); j++)
                {
                    if (i == 0)
                    {
                        XPSHelper.WriteTextBlockToGrid(ResultColumnsHeaders[j], grid, i, j + 1, HorizontalAlignment.Left, VerticalAlignment.Top, null, fontSize, null, FontWeights.Bold, true);
                    }
                    else
                    {
                        XPSHelper.WriteTextBlockToGrid(m_ReportData.GetResultCellValue(i - 1, j), grid, i, j + 1, HorizontalAlignment.Left, VerticalAlignment.Top, null, fontSize);
                    }
                }
            }
            return(m_ReportDocument.WriteRowContent(grid));
        }
Esempio n. 2
0
        /// <summary>method add OBX segment for result row
        /// </summary>
        /// <param name="rowIndex">row index</param>
        private void AddResultObxSegment(int rowIndex)
        {
            StringBuilder text = new StringBuilder();

            for (int colIndex = 0; colIndex < YpReportBase.ResultColumnsHeaders.Length; colIndex++)
            {
                if (colIndex == 1)
                {
                    text.Append(": ");
                }
                string cellValue = m_Data.GetResultCellValue(rowIndex, colIndex);
                if (!string.IsNullOrEmpty(cellValue) && colIndex > 1)
                {
                    text.Append(", ");
                }
                text.Append(cellValue);
            }
            AddObxSegment(text.ToString());
        }