public XlsDef Build() { var def = new XlsDef(); try { AdjustDocListForms(Report); _adjuster.Adjust(); def.Style.FontName = "Arial Narrow"; def.AddArea().AddEmptyRow(); var headArea = def.AddArea(); BuildSections(headArea, Headers); def.AddArea().AddEmptyRow(); var hRow = def.AddArea().AddRow(); hRow.ShowAllBorders(true); hRow.Style.FontStyle = FontStyle.Bold; hRow.Style.HAlign = HAlignment.Center; hRow.Style.BgColor = IndexedColors.BLUE_GREY.Index; //48; hRow.Style.FontColor = IndexedColors.WHITE.Index; hRow.Style.WrapText = true; var dRow = def.AddGrid(SqlDataSet).AddRow(); dRow.ShowAllBorders(true); dRow.Style.WrapText = true; var sourceMap = MapSources(); if (Report.Columns != null) { foreach (var column in Report.Columns) { AddColumn(hRow, dRow, column, sourceMap); } } def.AddArea().AddEmptyRow(); var footArea = def.AddArea(); BuildSections(footArea, Footers); def.ColumnWidths = _adjuster.ColumnSizes; return(def); } catch { def.Dispose(); throw; } }
protected XlsDef Build() { var def = new XlsDef(); try { AdjustDocListForms(Form); _adjuster.Adjust(); _captionColSpan = _adjuster.GetColumnSpanForPercent(50); _valueColSpan = Math.Max(_adjuster.ColumnCount - _captionColSpan, 1); def.Style.FontName = "Arial Narrow"; def.DefaultRowHeight = 13; var cell = def.AddArea().AddRow().AddText(Form.Caption); cell.Style.FontDSize = 2; cell.Style.FontStyle = FontStyle.Bold; cell.Style.FontColor = IndexedColors.DARK_BLUE.Index; // 18; cell.Style.HAlign = HAlignment.Center; cell.Style.AutoHeight = true; cell.ColSpan = _adjuster.ColumnCount; def.AddArea().AddEmptyRow(); // var area = def.AddArea(); if (Form.Children != null) { foreach (var control in Form.Children) { AddControlRow(def, /*area,*/ control); } } def.ColumnWidths = _adjuster.ColumnSizes; return(def); } catch { def.Dispose(); throw; } }
public XlsDef Build() { var def = new XlsDef(); try { AdjustDocListForms(Form); _adjuster.Adjust(); def.Style.FontName = "Arial Narrow"; /*var title = def.AddArea().AddRow().AddText(Form.Caption); * title.Style.FontDSize = 2; * title.Style.FontStyle = FontStyle.Bold; * title.Style.FontColor = IndexedColors.DARK_BLUE.Index; // 18; * title.Style.HAlign = HAlignment.Center; * title.Style.AutoHeight = true;*/ def.AddArea().AddEmptyRow(); var headArea = def.AddArea(); BuildSections(headArea, Headers); def.AddArea().AddEmptyRow(); var hRow = def.AddArea().AddRow(); hRow.ShowAllBorders(true); hRow.Style.FontStyle = FontStyle.Bold; hRow.Style.HAlign = HAlignment.Center; hRow.Style.BgColor = IndexedColors.BLUE_GREY.Index; //48; hRow.Style.FontColor = IndexedColors.WHITE.Index; hRow.Style.WrapText = true; var ds = ((DataSet)DataSet ?? SqlDataSet); var dRow = def.AddGrid(ds).AddRow(); dRow.ShowAllBorders(true); dRow.Style.WrapText = true; if (Form.Children != null) { foreach (var control in Form.Children) { AddControlBand(hRow, dRow, control); } } def.AddArea().AddEmptyRow(); var footArea = def.AddArea(); BuildSections(footArea, Footers); def.ColumnWidths = _adjuster.ColumnSizes; //title.ColSpan = dRow.GetCols(); return(def); } catch { def.Dispose(); throw; } }
public XlsDef Build() { var def = new XlsDef(); try { AdjustReportColumns(Table); _adjuster.Adjust(); def.Style.FontName = "Arial Narrow"; def.AddArea().AddEmptyRow(); var headArea = def.AddArea(); BuildSections(headArea, Headers); def.AddArea().AddEmptyRow(); var hRow = def.AddArea().AddRow(); hRow.ShowAllBorders(true); hRow.Style.FontStyle = FontStyle.Bold; hRow.Style.HAlign = HAlignment.Center; hRow.Style.BgColor = IndexedColors.BLUE_GREY.Index; //48; hRow.Style.FontColor = IndexedColors.WHITE.Index; hRow.Style.WrapText = true; var dRow = def.AddArea().AddRow(); dRow.ShowAllBorders(true); dRow.Style.WrapText = true; if (Report.Columns != null) { BuildHeaderColumns(hRow, dRow); foreach (var row in Table.Rows) { dRow = def.AddArea().AddRow(); dRow.ShowAllBorders(true); dRow.Style.WrapText = true; AddRow(dRow, row); } // Add Summary Row dRow = def.AddArea().AddRow(); dRow.ShowAllBorders(true); dRow.Style.WrapText = true; dRow.Style.FontStyle = FontStyle.Bold; var summaries = Table.GetColumnSummaries(); foreach (var data in summaries) { if (data is int) { dRow.AddInt((int)data); } else if (data is double) { dRow.AddFloat((double)data); } else { dRow.AddEmptyCell(); } } dRow.Style.AutoHeight = true; } def.AddArea().AddEmptyRow(); var footArea = def.AddArea(); BuildSections(footArea, Footers); def.ColumnWidths = _adjuster.ColumnSizes; return(def); } catch { def.Dispose(); throw; } }