protected void RenderLine(RPLLine reportItem, RPLElementProps rplProps, RPLLinePropsDef rplPropsDef, RPLItemMeasurement measurement, bool renderId, StyleContext styleContext) { if (this.html5Renderer.IsLineSlanted(measurement)) { if (renderId) { this.html5Renderer.RenderNavigationId(rplProps.UniqueName); } if (this.html5Renderer.m_deviceInfo.BrowserMode == BrowserMode.Quirks) { this.RenderVMLLine(reportItem, measurement, styleContext); } } else { bool flag = measurement.Height == 0.0; this.html5Renderer.WriteStream(HTMLElements.m_openSpan); if (renderId) { this.html5Renderer.RenderReportItemId(rplProps.UniqueName); } int num = 0; object obj = rplProps.Style[10]; if (obj != null) { this.html5Renderer.OpenStyle(); if (flag) { this.html5Renderer.WriteStream(HTMLElements.m_styleHeight); } else { this.html5Renderer.WriteStream(HTMLElements.m_styleWidth); } this.html5Renderer.WriteStream(obj); this.html5Renderer.WriteStream(HTMLElements.m_semiColon); } obj = rplProps.Style[0]; if (obj != null) { this.html5Renderer.OpenStyle(); this.html5Renderer.WriteStream(HTMLElements.m_backgroundColor); this.html5Renderer.WriteStream(obj); } this.html5Renderer.RenderReportItemStyle(reportItem, measurement, ref num); this.html5Renderer.CloseStyle(true); this.html5Renderer.WriteStream(HTMLElements.m_closeBracket); this.html5Renderer.WriteStream(HTMLElements.m_closeSpan); } }
internal void WriteItemToStream(RPLWriter rplWriter, PageContext pageContext) { BinaryWriter binaryWriter = rplWriter.BinaryWriter; if (binaryWriter != null) { Stream baseStream = binaryWriter.BaseStream; long position = baseStream.Position; binaryWriter.Write((byte)8); WriteElementProps(binaryWriter, rplWriter, pageContext, position + 1); m_offset = baseStream.Position; binaryWriter.Write((byte)254); binaryWriter.Write(position); binaryWriter.Write(byte.MaxValue); } else { m_rplElement = new RPLLine(); WriteElementProps(m_rplElement.ElementProps, rplWriter, pageContext); } }
private void FillAndFindOverlap(RPLItemMeasurement[] repItemCollection, double delta) { bool flag = false; int num = -1; int num2 = -1; int colSpans = 0; int rowSpans = 0; int num3 = 0; PageTableCell pageTableCell = null; int num4 = 0; RPLItemMeasurement rPLItemMeasurement = null; RPLElement rPLElement = null; while (num4 < repItemCollection.Length) { num = -1; num2 = -1; flag = false; rPLItemMeasurement = repItemCollection[num4]; if (SkipReportItem(rPLItemMeasurement)) { num4++; continue; } rPLElement = rPLItemMeasurement.Element; flag = FindRItemCell(rPLItemMeasurement, ref num, ref num2, delta); if (!flag && !(rPLElement is RPLLine)) { num4++; continue; } RPLLine rPLLine = rPLElement as RPLLine; if (rPLLine != null) { RPLLinePropsDef rPLLinePropsDef = rPLLine.ElementPropsDef as RPLLinePropsDef; float width = rPLItemMeasurement.Width; if ((width >= 0f && width < 0.01f) || (width < 0f && width > -0.01f)) { if (!flag) { int num5 = 0; bool flag2 = true; while (flag2 && num5 < m_nrRows) { if (m_tableGrid[num5 * m_nrCols].YValue == (float)((double)rPLItemMeasurement.Top - delta)) { num2 = num5; flag2 = false; } num5++; } num = m_nrCols - 1; if (!flag2) { AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, leftBorder: false); } } else { AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, leftBorder: true); } num4++; continue; } width = rPLItemMeasurement.Height; if ((width >= 0f && width < 0.01f) || (width < 0f && width > -0.01f)) { if (!flag) { int num6 = 0; bool flag3 = true; while (flag3 && num6 < m_nrCols) { if (m_tableGrid[num6].XValue == rPLItemMeasurement.Left) { num = num6; flag3 = false; } num6++; } num2 = m_nrRows - 1; AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, topBorder: false); } else { AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, topBorder: true); } num4++; continue; } } num3 = num + m_nrCols * num2; pageTableCell = m_tableGrid[num3]; if ((pageTableCell.InUse || pageTableCell.Eaten) && rPLElement is RPLLine && rPLItemMeasurement.Width != 0f && rPLItemMeasurement.Height != 0f) { num4++; continue; } ComputeColRowSpan(rPLItemMeasurement, num, num2, ref colSpans, ref rowSpans); AttachRItem(num, num2, colSpans, rowSpans, rPLItemMeasurement); num4++; } }
private void AttachHorizontalBorder(int xCellFound, int yCellFound, RPLMeasurement measurement, RPLLine currReportItem, bool topBorder) { double num = 0.0; int num2 = 0; int num3 = 0; PageTableCell pageTableCell = null; int num4 = 1; num2 = xCellFound; num3 = yCellFound * m_nrCols; pageTableCell = m_tableGrid[num2 + num3]; num = pageTableCell.DXValue.Value; if (topBorder) { pageTableCell.BorderTop = currReportItem; } else { pageTableCell.BorderBottom = currReportItem; } while ((double)measurement.Width - num > 0.0001) { num2++; if (num2 < m_nrCols) { pageTableCell = m_tableGrid[num2 + num3]; num += (double)pageTableCell.DXValue.Value; num4++; if (topBorder) { pageTableCell.BorderTop = currReportItem; } else { pageTableCell.BorderBottom = currReportItem; } continue; } break; } }
private void AttachVerticalBorder(int xCellFound, int yCellFound, RPLMeasurement measurement, RPLLine currReportItem, bool leftBorder) { int num = yCellFound; PageTableCell pageTableCell = m_tableGrid[xCellFound + num * m_nrCols]; double num2 = pageTableCell.DYValue.Value; if (leftBorder) { pageTableCell.BorderLeft = currReportItem; } else { pageTableCell.BorderRight = currReportItem; } while ((double)measurement.Height - num2 > 0.0001) { num++; if (num < m_nrRows) { pageTableCell = m_tableGrid[xCellFound + num * m_nrCols]; num2 += (double)pageTableCell.DYValue.Value; if (leftBorder) { pageTableCell.BorderLeft = currReportItem; } else { pageTableCell.BorderRight = currReportItem; } continue; } break; } }
private void RenderVMLLine(RPLLine line, RPLItemMeasurement measurement, StyleContext styleContext) { if (!this.hasSlantedLines) { this.html5Renderer.WriteStream("<?XML:NAMESPACE PREFIX=v /><?IMPORT NAMESPACE=\"v\" IMPLEMENTATION=\"#default#VML\" />"); this.hasSlantedLines = true; } this.html5Renderer.WriteStream(HTMLElements.m_openVGroup); this.html5Renderer.WriteStream(HTMLElements.m_openStyle); this.html5Renderer.WriteStream(HTMLElements.m_styleWidth); if (styleContext.InTablix) { this.html5Renderer.WriteStream(HTMLElements.m_percent); this.html5Renderer.WriteStream(HTMLElements.m_semiColon); this.html5Renderer.WriteStream(HTMLElements.m_styleHeight); this.html5Renderer.WriteStream(HTMLElements.m_percent); } else { this.html5Renderer.WriteRSStream(measurement.Width); this.html5Renderer.WriteStream(HTMLElements.m_semiColon); this.html5Renderer.WriteStream(HTMLElements.m_styleHeight); this.html5Renderer.WriteRSStream(measurement.Height); } this.html5Renderer.WriteStream(HTMLElements.m_closeQuote); this.html5Renderer.WriteStream(HTMLElements.m_openVLine); if (((RPLLinePropsDef)line.ElementProps.Definition).Slant) { this.html5Renderer.WriteStream(HTMLElements.m_rightSlant); } else { this.html5Renderer.WriteStream(HTMLElements.m_leftSlant); } IRPLStyle style = line.ElementProps.Style; string text = (string)style[0]; string text2 = (string)style[10]; if (text != null && text2 != null) { int value = new RPLReportColor(text).ToColor().ToArgb() & 0xFFFFFF; this.html5Renderer.WriteStream(HTMLElements.m_strokeColor); this.html5Renderer.WriteStream("#"); this.html5Renderer.WriteStream(Convert.ToString(value, 16)); this.html5Renderer.WriteStream(HTMLElements.m_quote); this.html5Renderer.WriteStream(HTMLElements.m_strokeWeight); this.html5Renderer.WriteStream(text2); this.html5Renderer.WriteStream(HTMLElements.m_closeQuote); } string theString = "solid"; string text3 = null; object obj = style[5]; if (obj != null) { string value2 = EnumStrings.GetValue((RPLFormat.BorderStyles)obj); if (string.CompareOrdinal(value2, "dashed") == 0) { theString = "dash"; } else if (string.CompareOrdinal(value2, "dotted") == 0) { theString = "dot"; } if (string.CompareOrdinal(value2, "double") == 0) { text3 = "thinthin"; } } this.html5Renderer.WriteStream(HTMLElements.m_dashStyle); this.html5Renderer.WriteStream(theString); if (text3 != null) { this.html5Renderer.WriteStream(HTMLElements.m_quote); this.html5Renderer.WriteStream(HTMLElements.m_slineStyle); this.html5Renderer.WriteStream(text3); } this.html5Renderer.WriteStream(HTMLElements.m_quote); this.html5Renderer.WriteStream(HTMLElements.m_closeTag); this.html5Renderer.WriteStreamCR(HTMLElements.m_closeVGroup); }
private void FillAndFindOverlap(RPLItemMeasurement[] repItemCollection, double delta) { bool flag = false; int num = -1; int num2 = -1; int colSpan = 0; int rowSpan = 0; int num3 = 0; PageTableCell pageTableCell = null; int num4 = 0; RPLItemMeasurement rPLItemMeasurement = null; RPLElement rPLElement = null; while (num4 < repItemCollection.Length) { num = -1; num2 = -1; flag = false; rPLItemMeasurement = repItemCollection[num4]; if (PageTableLayout.SkipReportItem(rPLItemMeasurement)) { num4++; } else { rPLElement = rPLItemMeasurement.Element; flag = this.FindRItemCell(rPLItemMeasurement, ref num, ref num2, delta); if (!flag && !(rPLElement is RPLLine)) { num4++; } else { RPLLine rPLLine = rPLElement as RPLLine; if (rPLLine != null) { RPLElementPropsDef elementPropsDef = rPLLine.ElementPropsDef; float width = rPLItemMeasurement.Width; if (width >= 0.0 && width < 0.0099999997764825821) { goto IL_00b8; } if (width < 0.0 && width > -0.0099999997764825821) { goto IL_00b8; } width = rPLItemMeasurement.Height; if (width >= 0.0 && width < 0.0099999997764825821) { goto IL_0176; } if (width < 0.0 && width > -0.0099999997764825821) { goto IL_0176; } } num3 = num + this.m_nrCols * num2; pageTableCell = this.m_tableGrid[num3]; if ((pageTableCell.InUse || pageTableCell.Eaten) && rPLElement is RPLLine && rPLItemMeasurement.Width != 0.0 && rPLItemMeasurement.Height != 0.0) { num4++; continue; } this.ComputeColRowSpan(rPLItemMeasurement, num, num2, ref colSpan, ref rowSpan); this.AttachRItem(num, num2, colSpan, rowSpan, rPLItemMeasurement); num4++; } } continue; IL_00b8: if (!flag) { int num5 = 0; bool flag2 = true; while (flag2 && num5 < this.m_nrRows) { if (this.m_tableGrid[num5 * this.m_nrCols].YValue == (float)((double)rPLItemMeasurement.Top - delta)) { num2 = num5; flag2 = false; } num5++; } num = this.m_nrCols - 1; if (!flag2) { this.AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, false); } } else { this.AttachVerticalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, true); } num4++; continue; IL_0176: if (!flag) { int num6 = 0; bool flag3 = true; while (flag3 && num6 < this.m_nrCols) { if (this.m_tableGrid[num6].XValue == rPLItemMeasurement.Left) { num = num6; flag3 = false; } num6++; } num2 = this.m_nrRows - 1; this.AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, false); } else { this.AttachHorizontalBorder(num, num2, rPLItemMeasurement, (RPLLine)rPLElement, true); } num4++; } }