コード例 #1
0
ファイル: XmlWriterImpl.cs プロジェクト: timothydodd/dbshell
 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
ファイル: HtmlWriter.cs プロジェクト: dbshell/dbshell
        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
ファイル: CsvWriter.cs プロジェクト: dbshell/dbshell
 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
ファイル: ExcelWriter.cs プロジェクト: dbshell/dbshell
 public ExcelWriter(TableInfo rowFormat, Worksheet sheet, DataFormatSettings dataFormat)
 {
     _rowFormat = rowFormat;
     _sheet = sheet;
     _formatter = new CdlValueFormatter(dataFormat ?? new DataFormatSettings());
 }
コード例 #6
0
ファイル: ExcelWriter.cs プロジェクト: timothydodd/dbshell
 public ExcelWriter(TableInfo rowFormat, ExcelWorksheet sheet, DataFormatSettings dataFormat)
 {
     _rowFormat = rowFormat;
     _sheet     = sheet;
     _formatter = new CdlValueFormatter(dataFormat ?? new DataFormatSettings());
 }