dotnetpro.WPF.TableReport.ReportPresenter.GenerateRows C# (CSharp) Метод

GenerateRows() приватный Метод

private GenerateRows ( int StartZeile, int EndZeile ) : void
StartZeile int
EndZeile int
Результат void
        private void GenerateRows(int StartZeile, int EndZeile)
        {
            try
            {
                if (StartZeile == EndZeile) return;
                if (oTable == null)
                {
                    oTable = new Grid();
                    oTable.BeginInit();
                }
                oTable.SetValue(TextBlock.FontFamilyProperty, new FontFamily("Verdana"));
                if (Configuration.FontSize < 4) configuration.FontSize = 8;
                oTable.SetValue(TextBlock.FontSizeProperty, (double)Configuration.FontSize);

                GenerateColumns();
                for (int i = StartZeile; i <= EndZeile + 1; i++)
                {
                    oTable.RowDefinitions.Add(new RowDefinition());
                }

                int ColBorders = 1;

                int ColBorderLeft = 1;
                int ColBorderRight = 0;
                int ColBorderButtom = 1;
                if (!HasRowLines)
                    ColBorderButtom = 0;

                if (!HasColumnLines) ColBorders = 0;

                int row = 1;
                int col = -1;
                
                GenerateHeaderRow(ColBorders);
                for (int currow = StartZeile; currow < EndZeile; currow++)
                {
                    DataRow item = oData.Rows[currow];
                    row++;

                    if (currow + 1 == EndZeile)
                        ColBorderButtom = 1;

                    int FirstCol = 1;
                    int colcount = 0; //nur ECHTE Spalten
                    col = -1;
                    for (int i = CurrentRange.From; i <= CurrentRange.Until; i++)
                    {
                        ColumnDefinition colDef = Columns[i];

                        col++;
                        ColBorderLeft = 1;
                        ColBorderRight = 0;
                        colcount++;
                        if (ColBorders == 0 && FirstCol != 1)
                            ColBorderLeft = 0;

                        if (colcount == (CurrentRange.Until - CurrentRange.From + 1))
                            ColBorderRight = 1;

                        string sValue = "";

                        sValue = item.Field<string>(colDef.Name);

                        if (sValue.Contains("\n"))
                            sValue = sValue.Split('\n')[0];
                        if (sValue.Contains("\r"))
                            sValue = sValue.Split('\r')[0];

                        GenerateCell(sValue, colDef, new Thickness(ColBorderLeft, 0, ColBorderRight, ColBorderButtom), row, col, null);

                        FirstCol = 0;
                    }
                }
                return;
            }
            catch (Exception ex)
            { }

        }