示例#1
0
 public XmlWriterImpl(System.Xml.XmlWriter writer, bool closeWriter, DataFormatSettings dataFormat, bool useAttributes, string rowElementName)
 {
     _writer         = writer;
     _dataFormat     = dataFormat;
     _formatter      = new CdlValueFormatter(_dataFormat ?? new DataFormatSettings());
     _useAttributes  = useAttributes;
     _closeWriter    = closeWriter;
     _rowElementName = rowElementName;
 }
示例#2
0
        public HtmlWriter(TextWriter stream, IEnumerable<string> header)
        {
            _stream = stream;
            _formatter = new CdlValueFormatter(new DataFormatSettings());

            _stream.Write(@"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
<html>
 <head>
  <meta http-equiv='content-type' content='text/html; charset=utf-8'>
  <meta name='generator' content='DB Shell, http://dbshell.com'>
  <style>
table {
    border: solid 1px #e8eef4;
    border-collapse: collapse;
}

table td {
    padding: 5px;
    border: solid 1px #e8eef4;
}

table th {
    padding: 6px 5px;
    text-align: left;
    background-color: #e8eef4;
    border: solid 1px #e8eef4;
}

body {
    font-size: .85em;
    font-family: 'Trebuchet MS', Verdana, Helvetica, Sans-Serif;
}

p, ul {
    margin-bottom: 20px;
    line-height: 1.6em;
}

h1 {
    font-size: 1.5em;
    color: #000;
    font-size: 2em;
}
  </style>
 </head>
 <body>
 <table>
<tr>
");
            foreach(var col in header)
            {
                _stream.WriteLine("<th>{0}</th>", HttpUtility.HtmlEncode(col));
            }
            _stream.Write("</tr>");
        }
示例#3
0
 public CsvWriter(TextWriter stream, char delimiter, char quote, char escape, char comment, CsvQuotingMode qmode, string lineEnds, DataFormatSettings dataFormat)
 {
     _stream = stream;
     _lineEnds = lineEnds;
     _delimiter = delimiter;
     _quote = quote;
     _escape = escape;
     _comment = comment;
     _qmode = qmode;
     _dataFormat = dataFormat;
     _formatter = new CdlValueFormatter(_dataFormat ?? new DataFormatSettings());
 }
示例#4
0
 public CsvWriter(TextWriter stream, char delimiter, char quote, char escape, char comment, CsvQuotingMode qmode, string lineEnds, DataFormatSettings dataFormat)
 {
     _stream     = stream;
     _lineEnds   = lineEnds;
     _delimiter  = delimiter;
     _quote      = quote;
     _escape     = escape;
     _comment    = comment;
     _qmode      = qmode;
     _dataFormat = dataFormat;
     _formatter  = new CdlValueFormatter(_dataFormat ?? new DataFormatSettings());
 }
示例#5
0
 public ExcelWriter(TableInfo rowFormat, Worksheet sheet, DataFormatSettings dataFormat)
 {
     _rowFormat = rowFormat;
     _sheet = sheet;
     _formatter = new CdlValueFormatter(dataFormat ?? new DataFormatSettings());
 }
示例#6
0
 public ExcelWriter(TableInfo rowFormat, ExcelWorksheet sheet, DataFormatSettings dataFormat)
 {
     _rowFormat = rowFormat;
     _sheet     = sheet;
     _formatter = new CdlValueFormatter(dataFormat ?? new DataFormatSettings());
 }