Пример #1
0
 internal SubReport(Microsoft.ReportingServices.OnDemandReportRendering.SubReport source)
     : base(source)
 {
     m_itemPageSizes             = new ItemSizes(source);
     base.KeepTogetherVertical   = (base.UnresolvedKTV = source.KeepTogether);
     base.KeepTogetherHorizontal = (base.UnresolvedKTH = source.KeepTogether);
 }
Пример #2
0
 internal override void WriteCustomSharedItemProps(RPLElementPropsDef sharedProps, RPLWriter rplWriter, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source;
     if (subReport.ReportName != null)
     {
         ((RPLSubReportPropsDef)sharedProps).ReportName = subReport.ReportName;
     }
 }
Пример #3
0
        internal static ReportItem CreateItem(IReportScope reportScope, IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, Microsoft.ReportingServices.ReportIntermediateFormat.ReportItem reportItemDef, RenderingContext renderingContext)
        {
            ReportItem reportItem = null;

            switch (reportItemDef.ObjectType)
            {
            case ObjectType.Textbox:
                reportItem = new TextBox(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.TextBox)reportItemDef, renderingContext);
                break;

            case ObjectType.Rectangle:
                reportItem = new Rectangle(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Rectangle)reportItemDef, renderingContext);
                break;

            case ObjectType.Image:
                reportItem = new Image(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Image)reportItemDef, renderingContext);
                break;

            case ObjectType.Line:
                reportItem = new Line(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Line)reportItemDef, renderingContext);
                break;

            case ObjectType.Subreport:
                reportItem = new SubReport(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.SubReport)reportItemDef, renderingContext);
                break;

            case ObjectType.Tablix:
                reportItem = new Tablix(parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Tablix)reportItemDef, renderingContext);
                break;

            case ObjectType.Chart:
                reportItem = new Chart(parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Chart)reportItemDef, renderingContext);
                break;

            case ObjectType.GaugePanel:
                reportItem = new GaugePanel(parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.GaugePanel)reportItemDef, renderingContext);
                break;

            case ObjectType.CustomReportItem:
            {
                Microsoft.ReportingServices.ReportIntermediateFormat.CustomReportItem customReportItem = (Microsoft.ReportingServices.ReportIntermediateFormat.CustomReportItem)reportItemDef;
                reportItem = new CustomReportItem(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, customReportItem, renderingContext);
                if (!((CustomReportItem)reportItem).Initialize(renderingContext))
                {
                    reportItem = CreateItem(reportScope, parentDefinitionPath, customReportItem.AltReportItemIndexInParentCollectionDef, customReportItem.AltReportItem, renderingContext);
                    reportItem.ReportItemDef.RepeatedSibling = customReportItem.RepeatedSibling;
                    reportItem.ReportItemDef.RepeatWith      = customReportItem.RepeatWith;
                    ProcessAlternateCustomReportItem(customReportItem, reportItem, renderingContext);
                }
                break;
            }

            case ObjectType.Map:
                reportItem = new Map(reportScope, parentDefinitionPath, indexIntoParentCollectionDef, (Microsoft.ReportingServices.ReportIntermediateFormat.Map)reportItemDef, renderingContext);
                break;
            }
            return(reportItem);
        }
Пример #4
0
 internal override void WriteCustomSharedItemProps(BinaryWriter spbifWriter, RPLWriter rplWriter, PageContext pageContext)
 {
     Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source;
     if (subReport.ReportName != null)
     {
         spbifWriter.Write((byte)15);
         spbifWriter.Write(subReport.ReportName);
     }
 }
Пример #5
0
        internal static void RegisterHiddenItem(ReportItem reportItem, PageContext pageContext, bool useForPageHFEval, Interactivity interactivity)
        {
            if (reportItem == null)
            {
                return;
            }
            bool flag = false;

            if (useForPageHFEval)
            {
                flag = HeaderFooterEval.AddToCurrentPage(reportItem);
            }
            if (interactivity != null && !interactivity.RegisterHiddenItem(reportItem, pageContext))
            {
                interactivity = null;
            }
            if (!flag && interactivity == null)
            {
                return;
            }
            if (reportItem is Microsoft.ReportingServices.OnDemandReportRendering.TextBox)
            {
                if (flag)
                {
                    Microsoft.ReportingServices.OnDemandReportRendering.TextBox textBox = reportItem as Microsoft.ReportingServices.OnDemandReportRendering.TextBox;
                    if (textBox != null)
                    {
                        ((TextBoxInstance)textBox.Instance).AddToCurrentPage();
                    }
                }
            }
            else if (reportItem is Microsoft.ReportingServices.OnDemandReportRendering.Rectangle)
            {
                RegisterHiddenItem(((Microsoft.ReportingServices.OnDemandReportRendering.Rectangle)reportItem).ReportItemCollection, pageContext, flag, interactivity);
            }
            else if (reportItem is Microsoft.ReportingServices.OnDemandReportRendering.SubReport)
            {
                if (interactivity == null)
                {
                    return;
                }
                Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)reportItem;
                SubReportInstance subReportInstance = (SubReportInstance)subReport.Instance;
                if (!subReportInstance.ProcessedWithError && !subReportInstance.NoRows)
                {
                    for (int i = 0; i < subReport.Report.ReportSections.Count; i++)
                    {
                        RegisterHiddenItem(subReport.Report.ReportSections[i].Body.ReportItemCollection, pageContext, useForPageHFEval: false, interactivity);
                    }
                }
            }
            else if (reportItem is Microsoft.ReportingServices.OnDemandReportRendering.Tablix)
            {
                RegisterHiddenItem((Microsoft.ReportingServices.OnDemandReportRendering.Tablix)reportItem, pageContext, flag, interactivity);
            }
        }
Пример #6
0
 internal void UpdateSubReportContents(SubReport subReport, Microsoft.ReportingServices.ReportRendering.SubReport renderSubreport)
 {
     if (renderSubreport != null)
     {
         m_renderReport = renderSubreport.Report;
     }
     if (m_reportSections != null)
     {
         m_reportSections[0].UpdateSubReportContents(m_renderReport);
     }
     if (m_parameters != null)
     {
         m_parameters.UpdateRenderReportItem(m_renderReport.Parameters);
     }
 }
Пример #7
0
        internal static ReportItem CreateShim(IDefinitionPath parentDefinitionPath, int indexIntoParentCollectionDef, bool inSubtotal, Microsoft.ReportingServices.ReportRendering.ReportItem renderReportItem, RenderingContext renderingContext)
        {
            ReportItem result = null;

            if (renderReportItem is Microsoft.ReportingServices.ReportRendering.TextBox)
            {
                result = new TextBox(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.TextBox)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Rectangle)
            {
                result = new Rectangle(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Rectangle)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Image)
            {
                result = new Image(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Image)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.List)
            {
                result = new Tablix(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.List)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Table)
            {
                result = new Tablix(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Table)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Matrix)
            {
                result = new Tablix(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Matrix)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Chart)
            {
                result = new Chart(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Chart)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.CustomReportItem)
            {
                result = new CustomReportItem(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.CustomReportItem)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.SubReport)
            {
                result = new SubReport(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.SubReport)renderReportItem, renderingContext);
            }
            else if (renderReportItem is Microsoft.ReportingServices.ReportRendering.Line)
            {
                result = new Line(parentDefinitionPath, indexIntoParentCollectionDef, inSubtotal, (Microsoft.ReportingServices.ReportRendering.Line)renderReportItem, renderingContext);
            }
            return(result);
        }
Пример #8
0
 private void VisitSubReport(Microsoft.ReportingServices.OnDemandReportRendering.SubReport subreportDef)
 {
     if (subreportDef.Report == null || subreportDef.Instance == null || subreportDef.ProcessedWithError)
     {
         return;
     }
     Microsoft.ReportingServices.OnDemandReportRendering.Report report = subreportDef.Report;
     if (!report.HasDocumentMap && !m_createSnapshot)
     {
         return;
     }
     foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection in report.ReportSections)
     {
         Visit(reportSection.Body.ReportItemCollection);
         VisitStyle(reportSection.Body.Style);
     }
 }
Пример #9
0
        private void CreateChildren(PageContext pageContext, PageItemHelper lastPageInfo, bool needsFirstBodyUpdate)
        {
            Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source;
            ReportSectionCollection reportSections = subReport.Report.ReportSections;

            if (m_childrenBody == null)
            {
                m_childrenBody = new PageItem[reportSections.Count];
                for (int i = m_bodyIndex; i < reportSections.Count; i++)
                {
                    m_childrenBody[i] = new ReportBody(subReport.Report.ReportSections[i].Body, subReport.Report.ReportSections[i].Width, pageContext);
                }
            }
            if (needsFirstBodyUpdate)
            {
                m_childrenBody[m_bodyIndex].UpdateItem(lastPageInfo.ChildPage);
                UpdateItemPageState(subReport.OmitBorderOnPageBreak);
            }
        }
Пример #10
0
 internal SubReport(Microsoft.ReportingServices.OnDemandReportRendering.SubReport source, PageContext pageContext, bool createForRepeat)
     : base(source)
 {
     if (pageContext != null)
     {
         if (createForRepeat)
         {
             m_itemPageSizes = pageContext.GetSharedFromRepeatItemSizesElement(source, isPadded: false);
         }
         else
         {
             m_itemPageSizes = pageContext.GetSharedItemSizesElement(source, isPadded: false);
         }
     }
     else
     {
         m_itemPageSizes = new ItemSizes(source);
     }
 }
 internal SubReportInstance(SubReport reportItemDef)
     : base(reportItemDef)
 {
 }
Пример #12
0
        internal override bool CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, double parentTopInPage, ref double parentPageHeight, Interactivity interactivity)
        {
            AdjustOriginFromItemsAbove(siblings, repeatWithItems);
            if (!HitsCurrentPage(pageContext, parentTopInPage))
            {
                return(false);
            }
            bool firstPage            = false;
            bool needsFirstBodyUpdate = false;

            CalculateIndexOfFirstBodyOnPage(lastPageInfo, out firstPage, out needsFirstBodyUpdate);
            ItemSizes contentSize = null;

            if (firstPage && ResolveItemHiddenState(rplWriter, interactivity, pageContext, createForRepeat: false, ref contentSize))
            {
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Bottom);
                if (rplWriter != null && m_itemRenderSizes == null)
                {
                    CreateItemRenderSizes(null, pageContext, createForRepeat: false);
                }
                return(true);
            }
            WriteStartItemToStream(rplWriter, pageContext);
            CreateChildren(pageContext, lastPageInfo, needsFirstBodyUpdate);
            Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = (Microsoft.ReportingServices.OnDemandReportRendering.SubReport)m_source;
            PageContext pageContext2 = pageContext;

            if (!pageContext2.FullOnPage)
            {
                if (base.IgnorePageBreaks)
                {
                    pageContext2 = new PageContext(pageContext, PageContext.PageContextFlags.FullOnPage, PageContext.IgnorePBReasonFlag.Toggled);
                }
                else if (firstPage && subReport.KeepTogether && !pageContext2.KeepTogether)
                {
                    pageContext2 = new PageContext(pageContext);
                    pageContext2.KeepTogether = true;
                }
            }
            m_bodiesOnPage = 0;
            double num  = parentTopInPage + m_itemPageSizes.Top;
            double num2 = 0.0;
            double num3 = 0.0;
            double num4 = 0.0;
            bool   flag = false;

            for (int i = m_bodyIndex; i < m_childrenBody.Length; i++)
            {
                if (flag)
                {
                    break;
                }
                PageItem pageItem     = m_childrenBody[i];
                double   parentHeight = 0.0;
                if (needsFirstBodyUpdate)
                {
                    pageItem.CalculatePage(rplWriter, lastPageInfo.ChildPage, pageContext2, null, null, num, ref parentHeight, interactivity);
                    needsFirstBodyUpdate = false;
                }
                else
                {
                    pageItem.CalculatePage(rplWriter, null, pageContext2, null, null, num, ref parentHeight, interactivity);
                }
                if (pageContext2.CancelPage)
                {
                    m_itemState    = State.Below;
                    m_rplElement   = null;
                    m_childrenBody = null;
                    return(false);
                }
                if (pageItem.ItemState == State.TopNextPage && i == 0)
                {
                    m_itemState = State.TopNextPage;
                    m_bodyIndex = -1;
                    return(false);
                }
                m_bodiesOnPage++;
                num        += parentHeight;
                num2       += parentHeight;
                m_itemState = State.OnPage;
                if (!pageContext2.FullOnPage)
                {
                    m_prevPageEnd = num2;
                    if (pageItem.ItemState != State.OnPage)
                    {
                        if (pageItem.ItemState == State.OnPagePBEnd && i == m_childrenBody.Length - 1)
                        {
                            m_itemState = State.OnPagePBEnd;
                        }
                        else
                        {
                            if (pageItem.ItemState == State.Below)
                            {
                                m_bodiesOnPage--;
                            }
                            m_itemState   = State.SpanPages;
                            m_prevPageEnd = 0.0;
                        }
                    }
                    if (m_itemState == State.SpanPages || m_itemState == State.OnPagePBEnd)
                    {
                        flag = true;
                    }
                    else if ((RoundedDouble)num >= pageContext2.PageHeight)
                    {
                        flag = true;
                        if (m_itemState == State.OnPage && i < m_childrenBody.Length - 1)
                        {
                            m_itemState = State.SpanPages;
                        }
                    }
                }
                if (rplWriter != null)
                {
                    num3  = Math.Max(num3, pageItem.ItemRenderSizes.Width);
                    num4 += pageItem.ItemRenderSizes.Height;
                }
            }
            if (contentSize == null)
            {
                m_itemPageSizes.AdjustHeightTo(m_childrenBody[m_bodyIndex + m_bodiesOnPage - 1].ItemPageSizes.Bottom);
            }
            else
            {
                contentSize.AdjustHeightTo(m_childrenBody[m_bodyIndex + m_bodiesOnPage - 1].ItemPageSizes.Bottom);
            }
            if (rplWriter != null)
            {
                CreateItemRenderSizes(contentSize, pageContext2, createForRepeat: false);
                m_itemRenderSizes.AdjustWidthTo(num3);
                m_itemRenderSizes.AdjustHeightTo(num4);
                WriteEndItemToStream(rplWriter, pageContext2);
            }
            if (m_itemState != State.SpanPages)
            {
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Bottom);
            }
            else
            {
                if (subReport.OmitBorderOnPageBreak)
                {
                    m_rplItemState |= 2;
                }
                parentPageHeight = Math.Max(parentPageHeight, m_itemPageSizes.Top + num2);
            }
            ReleaseBodyChildrenOnPage();
            m_bodyIndex += m_bodiesOnPage - 1;
            return(true);
        }
        private static ReportItem FindReportItem(Microsoft.ReportingServices.OnDemandReportRendering.Report report, IEnumerable <string> reportItemPathSteps, out Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection)
        {
            reportSection = null;
            int num = reportItemPathSteps.Count();

            if (num == 0)
            {
                return(null);
            }
            bool       flag       = num > 1;
            string     text       = reportItemPathSteps.FirstOrDefault();
            ReportItem reportItem = null;

            foreach (Microsoft.ReportingServices.OnDemandReportRendering.ReportSection reportSection2 in report.ReportSections)
            {
                foreach (ReportItem item in reportSection2.Body.ReportItemCollection)
                {
                    if (flag)
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.SubReport subReport = item as Microsoft.ReportingServices.OnDemandReportRendering.SubReport;
                        if (subReport != null && subReport.Report != null && string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = FindReportItem(subReport.Report, reportItemPathSteps.Skip(1), out reportSection);
                        }
                    }
                    else
                    {
                        Microsoft.ReportingServices.OnDemandReportRendering.Rectangle rectangle = item as Microsoft.ReportingServices.OnDemandReportRendering.Rectangle;
                        if (rectangle != null)
                        {
                            reportItem = FindReportItem(rectangle, text);
                        }
                        else if (string.CompareOrdinal(item.Name, text) == 0)
                        {
                            reportItem = item;
                        }
                    }
                    if (reportItem != null)
                    {
                        reportSection = reportSection2;
                        return(reportItem);
                    }
                }
            }
            return(null);
        }