Пример #1
0
        public void WriteColumnHeading(bool Dashes = false)
        {
            var lb = new BlankFillLineBuilder();
            int bx = 0;

            foreach (var colDefn in this.ColDefn)
            {
                var colName = colDefn.ColName;
                if (colDefn.WhichSide == WhichSide.Right)
                {
                    colName = colName.PadLeft(colDefn.Width);
                }

                lb.Put(colName, bx, colDefn.Width);
                bx += (colDefn.Width + 2);
            }

            this.ReportLines.Add(lb.ToString());

            if (Dashes == true)
            {
                var dashesLine = ToDashesLine();
                this.ReportLines.Add(dashesLine);
            }
        }
Пример #2
0
        private string ToDashesLine()
        {
            var lb = new BlankFillLineBuilder();
            int bx = 0;

            foreach (var colDefn in this.ColDefn)
            {
                string dashText = new string('-', colDefn.Width);
                lb.Put(dashText, bx, colDefn.Width);
                bx += (colDefn.Width + 2);
            }

            return(lb.ToString());
        }
Пример #3
0
        public void WriteDetail(string[] ColumnValues)
        {
            var lb = new BlankFillLineBuilder();
            int bx = 0;

            for (int ix = 0; ix < ColumnValues.Length; ++ix)
            {
                var colDefn = this.ColDefn[ix];
                var colText = ColumnValues[ix];
                if (colDefn.WhichSide == WhichSide.Right)
                {
                    colText = colText.PadLeft(colDefn.Width);
                }

                lb.Put(colText, bx, colDefn.Width);
                bx += (colDefn.Width + 2);
            }

            this.WriteTextLine(lb.ToString());
        }