private static int CompareRIsByX(ReportItem x, ReportItem y) { // order by left position int l1 = x.Left == null ? 0 : x.Left.Size; int l2 = y.Left == null ? 0 : y.Left.Size; int rc = l1 - l2; if (rc != 0) return rc; // then by width l1 = x.Width == null ? int.MaxValue : x.Width.Size; l2 = y.Width == null ? int.MaxValue : y.Width.Size; rc = l1 - l2; if (rc != 0) return rc; // then by y position int t1 = x.Top == null ? 0 : x.Top.Size; int t2 = y.Top == null ? 0 : y.Top.Size; return t1 - t2; }
public void MatrixCellStart(Matrix m, ReportItem ri, int row, int column, Row r, float h, float w, int colSpan) { }
public void MatrixCellEnd(Matrix m, ReportItem ri, int row, int column, Row r) { }
private static int CompareRIsByY(ReportItem x, ReportItem y) { // order by y position int t1 = x.Top == null ? 0 : x.Top.Size; int t2 = y.Top == null ? 0 : y.Top.Size; int rc = t1 - t2; if (rc != 0) return rc; // then by height t1 = x.Height == null ? int.MaxValue : x.Height.Size; t2 = y.Height == null ? int.MaxValue : y.Height.Size; rc = t1 - t2; if (rc != 0) return rc; // then by x position int l1 = x.Left == null ? 0 : x.Left.Size; int l2 = y.Left == null ? 0 : y.Left.Size; return l1 - l2; }
public void MatrixCellStart(Matrix m, ReportItem ri, int row, int column, Row r, float h, float w, int colSpan) { if (ri == null) // Empty cell? { if (_SkipMatrixCols == 0) tw.Write("<td>"); return; } string cssName = CssAdd(ri.Style, ri, r, false, h, w); // get the style name for this item tw.Write("<td id='{0}'", cssName); if (colSpan != 1) { tw.Write(" colspan={0}", colSpan); _SkipMatrixCols = -(colSpan - 1); // start it as negative as indicator that we need this </td> } else _SkipMatrixCols = 0; if (ri is Textbox) { var tb = (Textbox) ri; if (tb.IsToggle && tb.Name != null) // name is required for this { string name = tb.Name.Nm + "_" + (tb.RunCount(this.r) + 1).ToString(); bScriptToggle = true; // we need to generate JavaScript in header // TODO -- need to calculate the hide count correctly tw.Write(" onClick=\"hideShow(this, {0}, '{1}')\" onMouseOver=\"style.cursor ='hand'\"", 0, name); } } tw.Write(">"); }
int PositioningWidth(ReportItem ri) { int w; if (ri.Width == null) { if (ri is Table) { Table t = ri as Table; w = t.WidthInUnits; } else w = int.MaxValue/2; // MaxValue/2 is just meant to be a large number (but won't overflow when adding in the x) } else w = ri.Width.Size; return w; }
private StyleInfo GetStyle(ReportItem ri, Row row) { if (ri.Style == null) return null; return ri.Style.GetStyleInfo(r, row); }
public void MatrixCellEnd(Matrix m, ReportItem ri, int row, int column, Row r) { if (_SkipMatrixCols == 0) tw.Write("</td>"); else if (_SkipMatrixCols < 0) { tw.Write("</td>"); _SkipMatrixCols = -_SkipMatrixCols; } else _SkipMatrixCols--; return; }
private static bool InList(ReportItem tb) { Type tp = tb.Parent.Parent.GetType(); return (tp == typeof(List)); }
private static bool InTable(ReportItem tb) { Type tp = tb.Parent.Parent.GetType(); return (tp == typeof(TableCell) || tp == typeof(Corner) || tp == typeof(DynamicColumns) || tp == typeof(DynamicRows) || tp == typeof(StaticRow) || tp == typeof(StaticColumn) || tp == typeof(Subtotal) || tp == typeof(MatrixCell)); }
float _XPosition; // position of cell #endregion Fields #region Constructors internal MatrixCellEntry(Rows d, ReportItem ri) { _Data = d; _DisplayItem = ri; _ColSpan = 1; }
public void MatrixCellStart(Matrix m, ReportItem ri, int row, int column, Row r, float h, float w, int colSpan) { _MatrixCellSpan = colSpan; // save this so that we can put out the right number of \cell if (column != 0) return; // Handle start of new row tw.Write(@"\trowd \trql\trgaph108\trrh0\trleft236"); if (row < _MatrixHeaderRows) // repeat table header on multiple pages tw.Write(@"\trhdr"); int pos = 0; foreach (int width in _MatrixColumnWidths) { pos += width; string border; if (ri != null && ri.Style != null) { StyleInfo si = ri.Style.GetStyleInfo(this.r, r); border = string.Format(@"\clbrdrt\{0}\clbrdrl\{1}\clbrdrb\{2}\clbrdrr\{3}", GetBorderStyle(si.BStyleTop), GetBorderStyle(si.BStyleLeft), GetBorderStyle(si.BStyleBottom), GetBorderStyle(si.BStyleRight)); } else border = @"\clbrdrt\brdrs\clbrdrl\brdrs\clbrdrb\brdrs\clbrdrr\brdrs"; tw.Write(@"{1}\cellx{0}", pos, border); } tw.Write(@"\pard \intbl"); }
public void MatrixCellEnd(Matrix m, ReportItem ri, int row, int column, Row r) { tw.Write(@"\cell"); }