Ejemplo n.º 1
0
        public void RenderReportItem(RPLElement reportItem, RPLItemMeasurement measurement, StyleContext styleContext, ref int borderContext, bool renderId, bool treatAsTopLevel)
        {
            RPLSubReport       rPLSubReport = (RPLSubReport)reportItem;
            RPLElementProps    elementProps = reportItem.ElementProps;
            RPLElementPropsDef definition   = elementProps.Definition;

            using (html5Renderer.m_reportContext.EnterSubreport(definition))
            {
                if (!styleContext.InTablix || renderId)
                {
                    styleContext.RenderMeasurements = false;
                    html5Renderer.WriteStream(HTMLElements.m_openDiv);
                    html5Renderer.RenderReportItemStyle(rPLSubReport, elementProps, definition, measurement, styleContext, ref borderContext, definition.ID);
                    if (renderId)
                    {
                        html5Renderer.RenderReportItemId(elementProps.UniqueName);
                    }
                    html5Renderer.WriteStreamCR(HTMLElements.m_closeBracket);
                }
                RPLItemMeasurement[] children = rPLSubReport.Children;
                int  num             = 0;
                int  num2            = borderContext;
                bool usePercentWidth = children.Length != 0;
                int  num3            = children.Length;
                for (int i = 0; i < num3; i++)
                {
                    if (i == 0 && num3 > 1 && (borderContext & 8) > 0)
                    {
                        num2 &= -9;
                    }
                    else if (i == 1 && (borderContext & 4) > 0)
                    {
                        num2 &= -5;
                    }
                    if (i > 0 && i == num3 - 1 && (borderContext & 8) > 0)
                    {
                        num2 |= 8;
                    }
                    num = num2;
                    RPLItemMeasurement rPLItemMeasurement = children[i];
                    RPLContainer       rPLContainer       = (RPLContainer)rPLItemMeasurement.Element;
                    RPLElementProps    elementProps2      = rPLContainer.ElementProps;
                    RPLElementPropsDef definition2        = elementProps2.Definition;
                    html5Renderer.m_isBody          = true;
                    html5Renderer.m_usePercentWidth = usePercentWidth;
                    new RectangleRenderer(html5Renderer).RenderReportItem(rPLContainer, rPLItemMeasurement, new StyleContext(), ref num, renderId: false, treatAsTopLevel);
                }
                if (!styleContext.InTablix || renderId)
                {
                    html5Renderer.WriteStreamCR(HTMLElements.m_closeDiv);
                }
            }
        }
Ejemplo n.º 2
0
        internal override void ProcessRenderingElementContent(RPLElement rplElement, GdiContext context, RectangleF bounds)
        {
            RPLContainer rPLContainer = (RPLContainer)rplElement;

            if (rPLContainer.Children == null)
            {
                return;
            }
            if (rPLContainer.Children.Length == 1)
            {
                RenderingItem renderingItem = RenderingItem.CreateRenderingItem(context, rPLContainer.Children[0], bounds);
                if (renderingItem != null)
                {
                    base.Children.Add(renderingItem);
                }
                rPLContainer.Children = null;
                return;
            }
            List <RPLItemMeasurement> list = new List <RPLItemMeasurement>(rPLContainer.Children.Length);

            for (int i = 0; i < rPLContainer.Children.Length; i++)
            {
                list.Add(rPLContainer.Children[i]);
            }
            rPLContainer.Children = null;
            RectangleF bounds2 = bounds;

            for (int j = 0; j < list.Count; j++)
            {
                RPLItemMeasurement rPLItemMeasurement = list[j];
                rPLItemMeasurement.Width = bounds.Width;
                bounds2.Height           = rPLItemMeasurement.Height;
                RenderingItem renderingItem2 = RenderingItem.CreateRenderingItem(context, rPLItemMeasurement, bounds2);
                if (renderingItem2 != null)
                {
                    base.Children.Add(renderingItem2);
                }
                bounds2.Y += rPLItemMeasurement.Height;
                list[j]    = null;
            }
        }
Ejemplo n.º 3
0
        internal override void ProcessRenderingElementContent(RPLElement rplElement, GdiContext context, RectangleF bounds)
        {
            RPLContainer rPLContainer = (RPLContainer)rplElement;

            if (rPLContainer.Children == null)
            {
                return;
            }
            if (rPLContainer.Children.Length == 1)
            {
                RenderingItem renderingItem = RenderingItem.CreateRenderingItem(context, rPLContainer.Children[0], bounds);
                if (renderingItem != null)
                {
                    Children.Add(renderingItem);
                }
                rPLContainer.Children = null;
                return;
            }
            List <RPLItemMeasurement> list = new List <RPLItemMeasurement>(rPLContainer.Children.Length);

            for (int i = 0; i < rPLContainer.Children.Length; i++)
            {
                list.Add(rPLContainer.Children[i]);
            }
            rPLContainer.Children = null;
            list.Sort(new ZIndexComparer());
            for (int j = 0; j < list.Count; j++)
            {
                RenderingItem renderingItem2 = RenderingItem.CreateRenderingItem(context, list[j], bounds);
                if (renderingItem2 != null)
                {
                    Children.Add(renderingItem2);
                }
                list[j] = null;
            }
        }
 protected override bool RenderRectangleItemAndLines(RPLContainer rectangle, BorderContext borderContext, int y, PageTableCell cell, string linkToChildId, float runningLeft, bool rowUsed)
 {
     RenderLines(y, cell, borderContext);
     rowUsed = RenderRectangleItem(y, cell, borderContext, linkToChildId, rectangle, runningLeft, rowUsed);
     return(rowUsed);
 }
Ejemplo n.º 5
0
        protected void RenderRectangle(RPLContainer rectangle, RPLElementProps props, RPLElementPropsDef def, RPLItemMeasurement measurement, ref int borderContext, bool renderId, StyleContext styleContext, bool treatAsTopLevel)
        {
            RPLItemMeasurement[] children             = rectangle.Children;
            RPLRectanglePropsDef rPLRectanglePropsDef = def as RPLRectanglePropsDef;

            if (rPLRectanglePropsDef != null && rPLRectanglePropsDef.LinkToChildId != null)
            {
                this.html5Renderer.m_linkToChildStack.Push(rPLRectanglePropsDef.LinkToChildId);
            }
            bool   expandItem = this.html5Renderer.m_expandItem;
            bool   flag       = renderId;
            string text       = props.UniqueName;
            bool   flag2      = children == null || children.Length == 0;

            if (flag2 && styleContext.InTablix)
            {
                return;
            }
            bool flag3 = this.html5Renderer.m_deviceInfo.OutlookCompat || !this.html5Renderer.m_browserIE || (flag2 && this.html5Renderer.m_usePercentWidth);

            if (!styleContext.InTablix || renderId)
            {
                if (flag3)
                {
                    this.html5Renderer.WriteStream(HTMLElements.m_openTable);
                    this.html5Renderer.WriteStream(HTMLElements.m_zeroBorder);
                }
                else
                {
                    this.html5Renderer.WriteStream(HTMLElements.m_openDiv);
                    if (this.html5Renderer.m_deviceInfo.IsBrowserIE && this.html5Renderer.m_deviceInfo.AllowScript)
                    {
                        if (!this.needsGrowRectangleScript)
                        {
                            this.CreateGrowRectIdsStream();
                        }
                        flag = true;
                        if (!renderId)
                        {
                            text = props.UniqueName + "_gr";
                        }
                        this.html5Renderer.WriteIdToSecondaryStream(this.html5Renderer.m_growRectangleIdsStream, text);
                    }
                }
                if (flag)
                {
                    this.html5Renderer.RenderReportItemId(text);
                }
                if (this.html5Renderer.m_isBody)
                {
                    this.html5Renderer.m_isBody     = false;
                    styleContext.RenderMeasurements = false;
                    if (flag2)
                    {
                        this.html5Renderer.OpenStyle();
                        if (this.html5Renderer.m_usePercentWidth)
                        {
                            this.html5Renderer.RenderMeasurementHeight(measurement.Height);
                            this.html5Renderer.WriteStream(HTMLElements.m_styleWidth);
                            this.html5Renderer.WriteStream(HTMLElements.m_percent);
                            this.html5Renderer.WriteStream(HTMLElements.m_semiColon);
                        }
                        else
                        {
                            this.RenderRectangleMeasurements(measurement, props.Style);
                        }
                    }
                    else if (flag3 && this.html5Renderer.m_usePercentWidth)
                    {
                        this.html5Renderer.OpenStyle();
                        this.html5Renderer.WriteStream(HTMLElements.m_styleWidth);
                        this.html5Renderer.WriteStream(HTMLElements.m_percent);
                        this.html5Renderer.WriteStream(HTMLElements.m_semiColon);
                    }
                    this.html5Renderer.m_usePercentWidth = false;
                }
                if (!styleContext.InTablix)
                {
                    if (styleContext.RenderMeasurements)
                    {
                        this.html5Renderer.OpenStyle();
                        this.RenderRectangleMeasurements(measurement, props.Style);
                    }
                    this.html5Renderer.RenderReportItemStyle((RPLElement)rectangle, props, def, measurement, styleContext, ref borderContext, def.ID);
                }
                this.html5Renderer.CloseStyle(true);
                this.html5Renderer.WriteToolTip(props);
                this.html5Renderer.WriteStreamCR(HTMLElements.m_closeBracket);
                if (flag3)
                {
                    this.html5Renderer.WriteStream(HTMLElements.m_firstTD);
                    this.html5Renderer.OpenStyle();
                    if (flag2)
                    {
                        this.html5Renderer.RenderMeasurementStyle(measurement.Height, measurement.Width);
                        this.html5Renderer.WriteStream(HTMLElements.m_fontSize);
                        this.html5Renderer.WriteStream("1pt");
                    }
                    else
                    {
                        this.html5Renderer.WriteStream(HTMLElements.m_verticalAlign);
                        this.html5Renderer.WriteStream(HTMLElements.m_topValue);
                    }
                    this.html5Renderer.CloseStyle(true);
                    this.html5Renderer.WriteStream(HTMLElements.m_closeBracket);
                }
            }
            if (flag2)
            {
                this.html5Renderer.WriteStream(HTMLElements.m_nbsp);
            }
            else
            {
                bool inTablix = styleContext.InTablix;
                styleContext.InTablix = false;
                flag2 = this.html5Renderer.GenerateHTMLTable(children, measurement.Top, measurement.Left, measurement.Width, measurement.Height, borderContext, expandItem, SharedListLayoutState.None, null, props.Style, treatAsTopLevel);
                if (inTablix)
                {
                    styleContext.InTablix = true;
                }
            }
            if (!styleContext.InTablix || renderId)
            {
                if (flag3)
                {
                    this.html5Renderer.WriteStream(HTMLElements.m_lastTD);
                    this.html5Renderer.WriteStream(HTMLElements.m_closeTable);
                }
                else
                {
                    this.html5Renderer.WriteStreamCR(HTMLElements.m_closeDiv);
                }
            }
            if (this.html5Renderer.m_linkToChildStack.Count > 0 && rPLRectanglePropsDef != null && rPLRectanglePropsDef.LinkToChildId != null && rPLRectanglePropsDef.LinkToChildId.Equals(this.html5Renderer.m_linkToChildStack.Peek()))
            {
                this.html5Renderer.m_linkToChildStack.Pop();
            }
        }
Ejemplo n.º 6
0
        private static void ReadMeasurement(RPLElement element, ALayout layout, int top, int left, int generationIndex, BlockOutlines blockOutlines, Dictionary <string, ToggleParent> toggleParents, bool suppressOutlines, int elementWidth, string subreportLanguage)
        {
            RPLContainer rPLContainer = element as RPLContainer;

            if (rPLContainer != null)
            {
                if (rPLContainer.Children != null)
                {
                    bool         flag         = false;
                    int          num          = 0;
                    RPLSubReport rPLSubReport = element as RPLSubReport;
                    if (rPLSubReport != null)
                    {
                        flag = true;
                        if (!suppressOutlines)
                        {
                            toggleParents = new Dictionary <string, ToggleParent>();
                        }
                        string language = ((RPLSubReportProps)rPLSubReport.ElementProps).Language;
                        if (!string.IsNullOrEmpty(language))
                        {
                            subreportLanguage = language;
                        }
                    }
                    int[]     array  = new int[rPLContainer.Children.Length];
                    int[]     array2 = new int[rPLContainer.Children.Length];
                    int[]     array3 = new int[rPLContainer.Children.Length];
                    RPLItem[] array4 = new RPLItem[rPLContainer.Children.Length];
                    for (int i = 0; i < rPLContainer.Children.Length; i++)
                    {
                        RPLItemMeasurement rPLItemMeasurement = rPLContainer.Children[i];
                        if (0.0 == rPLItemMeasurement.Width && 0.0 == rPLItemMeasurement.Height)
                        {
                            rPLContainer.Children[i] = null;
                        }
                        else
                        {
                            if ((0.0 == rPLItemMeasurement.Width || 0.0 == rPLItemMeasurement.Height) && !(rPLItemMeasurement.Element is RPLLine))
                            {
                                rPLContainer.Children[i] = null;
                                continue;
                            }
                            int num2 = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Height);
                            int num3 = 0;
                            if (flag)
                            {
                                num3      = elementWidth;
                                array2[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top) + top + num;
                                num      += num2;
                            }
                            else
                            {
                                num3      = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Width);
                                array2[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Top) + top;
                            }
                            array[i]  = num3;
                            array3[i] = LayoutConvert.ConvertMMTo20thPoints((double)rPLItemMeasurement.Left) + left;
                            RPLItem      rPLItem   = array4[i] = rPLItemMeasurement.Element;
                            byte         b         = default(byte);
                            RPLItemProps itemProps = layout.RPLReport.GetItemProps(rPLItem.RPLSource, out b);
                            if (b == 7)
                            {
                                RPLTextBoxPropsDef rPLTextBoxPropsDef = (RPLTextBoxPropsDef)itemProps.Definition;
                                if (rPLTextBoxPropsDef.IsSimple)
                                {
                                    layout.AddReportItem(rPLItem.RPLSource, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents);
                                }
                                else
                                {
                                    layout.AddReportItem(rPLItem, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents);
                                }
                                if (!suppressOutlines && rPLTextBoxPropsDef.IsToggleParent && !toggleParents.ContainsKey(rPLTextBoxPropsDef.Name))
                                {
                                    toggleParents.Add(rPLTextBoxPropsDef.Name, new ToggleParent(array2[i], array3[i], num3, num2));
                                }
                            }
                            else
                            {
                                layout.AddReportItem(rPLItem.RPLSource, array2[i], array3[i], num3, num2, generationIndex, rPLItemMeasurement.State, subreportLanguage, toggleParents);
                            }
                        }
                    }
                    for (int j = 0; j < rPLContainer.Children.Length; j++)
                    {
                        if (rPLContainer.Children[j] != null)
                        {
                            Reader.ReadMeasurement(array4[j], layout, array2[j], array3[j], generationIndex + 1, blockOutlines, toggleParents, suppressOutlines, array[j], subreportLanguage);
                            rPLContainer.Children[j] = null;
                            array4[j] = null;
                        }
                    }
                    rPLContainer.Children = null;
                }
            }
            else
            {
                Reader.ReadTablixStructure(element as RPLTablix, layout, top, left, generationIndex, blockOutlines, toggleParents, suppressOutlines, subreportLanguage);
            }
        }