/// <summary>
 /// Cria a tabela que receberá os dados do relatório
 /// </summary>
 public void CreateDataTable(String[] columnNames, int[] columnWidths, int rowCount)
 {
     reportTable             = new Table(columnNames.Length, rowCount + 2);
     reportTable.Width       = 100;
     reportTable.Cellspacing = 4;
     reportTable.SetWidths(columnWidths);
     for (int ndx = 0; ndx < columnNames.Length; ndx++)
     {
         Cell columnName = CreateCell(new ReportCell(columnNames[ndx]), ndx);
         columnName.BackgroundColor = new Color(165, 185, 250);
         reportTable.AddCell(columnName);
     }
     totalizer = new ReportTotalizer(columnNames.Length);
 }
Example #2
0
        /// <summary>
        /// Cria a tabela que receberá os dados do relatório
        /// </summary>
        public void CreateDataTable(String[] columnNames, int[] columnWidths, int rowCount)
        {
            // Define o nome da planilha e a largura das colunas
            reportSheet = document.Workbook.Worksheets.Add(reportHeaders[0]);
            ColumnInfo info = new ColumnInfo(document, reportSheet);

            info.ColumnIndexStart = 1;
            info.ColumnIndexEnd   = (ushort)columnNames.Length;
            info.Width            = 5100;
            reportSheet.AddColumnInfo(info);

            // Prepara o plano de fundo da planilha
            this.rowCount = rowCount;
            for (int row = 1; row < rowCount + 10; row++)
            {
                for (int col = 1; col < columnNames.Length + 3; col++)
                {
                    SetCellPattern(row, col);
                }
            }

            // Insere o cabeçalho da planilha
            ProcessHeaders(columnNames.Length);

            // Cria celulas com os nomes das colunas
            for (int ndx = 0; ndx < columnNames.Length; ndx++)
            {
                Cell columnName = reportSheet.Cells.Add(6, ndx + 2, columnNames[ndx]);
                columnName.Font.Bold    = true;
                columnName.PatternColor = Colors.Default1F;
                columnName.Pattern      = 1;
                SetCellBorder(columnName);
            }

            // Cria o totalizador
            totalizer = new ReportTotalizer(columnNames.Length);
        }
        /// <summary>
        /// Cria a tabela que receberá os dados do relatório, no .CSV apenas separa os nomes das
        /// colunas pois essa tabela não existe fisicamente
        /// </summary>
        public void CreateDataTable(String[] columnNames, int[] columnWidths, int rowCount)
        {
            // Grava os comentários no arquivo
            // streamWriter.WriteLine(csvComment);  removi para facilitar importação no excel

            // Grava os nomes das colunas no arquivo
            String columnList = null;

            for (int ndx = 0; ndx < columnNames.Length; ndx++)
            {
                if (!String.IsNullOrEmpty(columnList))
                {
                    columnList += ",";
                }
                columnList += columnNames[ndx];
            }
            streamWriter.WriteLine(columnList);

            // Verifica o separador decimal, para depois não misturar com as virgulas que separam os campos do CSV
            decimalSeparatorIsComma = FieldParser.IsCommaDecimalSeparator();

            // Cria o totalizador
            totalizer = new ReportTotalizer(columnNames.Length);
        }
Example #4
0
 /// <summary>
 /// Cria a tabela que receberá os dados do relatório
 /// </summary>
 public void CreateDataTable(String[] columnNames, int[] columnWidths, int rowCount)
 {
     reportTable = new ReportTable(media, columnNames);
     totalizer   = new ReportTotalizer(columnNames.Length);
 }