private void populateCacheRow(CTable cacheRow, CMergeCellParam mergedParam, CRow row, CColumn col) { String text = col.GetText().Text; ArrayList columns = cacheRow.GetChildArray("COLUMNS"); CTable cacheColumn = new CTable(""); columns.Add(cacheColumn); int fromCell = mergedParam.FromCell + 1; int toCell = mergedParam.ToCell + 1; int span = mergedParam.CellMergedCount; cacheColumn.SetFieldValue("TEXT", text); cacheColumn.SetFieldValue("FROM_CELL", fromCell.ToString()); cacheColumn.SetFieldValue("TO_CELL", toCell.ToString()); cacheColumn.SetFieldValue("CELL_SPAN", span.ToString()); Boolean isBold = row.GetFontWeight().Equals(System.Windows.FontWeights.Bold); String dt = col.getDataType(); System.Windows.HorizontalAlignment align = col.GetHorizontalAlignment(); cacheColumn.SetFieldValue("IS_BOLD", isBold.ToString()); cacheColumn.SetFieldValue("TYPE", dt); cacheColumn.SetFieldValue("TEXT_ALIGN", align.ToString()); cacheColumn.SetFieldValue("IS_MERGED", mergedParam.IsMerged.ToString()); }
public void FillColumnsText(ArrayList values) { int i = 0; foreach (String rc in values) { CColumn c = (CColumn)columns[i]; c.GetText().Text = rc; i++; } }
public void FillColumnsText(params String[] values) { int i = 0; foreach (String value in values) { CColumn c = (CColumn)columns[i]; c.GetText().Text = value; i++; } }
public void AddRow(CRow row) { String name = row.GetName(); if (name.Contains("GLB_HEADER_LEVEL0")) { currentPage++; } if ((currentPage > 1) && name.Contains("HEADER")) { //Skip header if page greater than 1 return; } currentRow++; ArrayList arr = (ArrayList)rowMergedParam[name]; if (arr == null) { return; } int cnt = row.GetColumnCount(); String rowText = String.Format("{0}", name); CTable cacheRow = new CTable("ROW"); cacheRow.SetFieldValue("ROW_ID", currentRow.ToString()); cacheRow.SetFieldValue("ROW_TYPE", row.GetName()); cacheRow.AddChildArray("COLUMNS", new ArrayList()); cacheRows.Add(cacheRow); for (int i = 0; i < cnt; i++) { CMergeCellParam mergedParam = (CMergeCellParam)arr[i]; CColumn col = row.GetColumn(i); String text = col.GetText().Text; populateCacheRow(cacheRow, mergedParam, row, col); } String dummy = rowText; }
protected void ConstructUIRow(UReportPage page, CRow row) { double maxh = 0.00; Grid grd = new Grid(); RowDefinition rd = new RowDefinition(); rd.Height = new GridLength(row.GetHeight()); grd.RowDefinitions.Add(rd); if (excel != null) { excel.AddRow(row); } int cnt = row.GetColumnCount(); for (int i = 0; i < cnt; i++) { CColumn clm = row.GetColumn(i); ColumnDefinition cd = new ColumnDefinition(); cd.Width = clm.GetWidth(); grd.ColumnDefinitions.Add(cd); } for (int i = 0; i < cnt; i++) { CColumn clm = row.GetColumn(i); Border bd = new Border(); bd.BorderBrush = clm.GetBorderColor(); bd.BorderThickness = clm.GetBorderThickness(); bd.VerticalAlignment = VerticalAlignment.Stretch; bd.HorizontalAlignment = HorizontalAlignment.Stretch; TextBlock tblk = new TextBlock(); tblk.Margin = row.GetMargin(); tblk.HorizontalAlignment = clm.GetHorizontalAlignment(); tblk.VerticalAlignment = clm.GetVertocalAlignment(); tblk.Text = clm.GetText().Text; //tblk.TextWrapping = TextWrapping.Wrap; if (row.GetFontFamily() != null) { tblk.FontFamily = row.GetFontFamily(); } tblk.FontWeight = row.GetFontWeight(); tblk.FontStyle = row.GetFontStyle(); if (row.GetFontSize() > 0) { tblk.FontSize = row.GetFontSize(); } if (tblk.ActualHeight > maxh) { maxh = tblk.ActualHeight; } bd.Child = tblk; Grid.SetColumn(bd, i); grd.Children.Add(bd); } page.AddRowPannel(grd); }