Exemple #1
0
        protected override void CreateChildren(PageContext pageContext)
        {
            ReportSectionCollection reportSections = (m_source as Microsoft.ReportingServices.OnDemandReportRendering.SubReport).Report.ReportSections;
            int count = reportSections.Count;

            m_children           = new PageItem[count];
            m_indexesLeftToRight = new int[count];
            m_rightPadding       = 0.0;
            m_bottomPadding      = 0.0;
            double num = 0.0;

            for (int i = 0; i < count; i++)
            {
                ReportBody reportBody = new ReportBody(reportSections[i].Body, reportSections[i].Width);
                reportBody.CacheNonSharedProperties(pageContext);
                reportBody.ItemPageSizes.Top = num;
                m_indexesLeftToRight[i]      = i;
                num += reportBody.ItemPageSizes.Height;
                if (i > 0)
                {
                    List <int> list = new List <int>(1);
                    list.Add(i - 1);
                    reportBody.PageItemsAbove = list;
                }
                m_children[i] = reportBody;
            }
        }
 internal ColumnDetail(double leftEdge, double topEdge, ReportBody reportBody)
 {
     m_left    = leftEdge;
     m_top     = topEdge;
     m_width   = reportBody.ItemPageSizes.Width;
     m_height  = reportBody.ItemPageSizes.Height;
     m_offset  = reportBody.Offset;
     m_element = (RPLBody)reportBody.RPLElement;
 }
Exemple #3
0
 protected override void DetermineContentHorizontalSize(PageContext pageContext, double leftInParentSystem, double rightInParentSystem, List <PageItem> ancestors, bool anyAncestorHasKT, bool hasUnpinnedAncestors, bool resolveState, bool resolveItem)
 {
     base.DetermineContentHorizontalSize(pageContext, leftInParentSystem, rightInParentSystem, ancestors, anyAncestorHasKT, hasUnpinnedAncestors, resolveState, resolveItem);
     if (m_children.Length <= 1)
     {
         return;
     }
     for (int i = 0; i < m_children.Length; i++)
     {
         ReportBody reportBody = m_children[i] as ReportBody;
         if (reportBody != null)
         {
             if (!reportBody.OnThisVerticalPage)
             {
                 break;
             }
             if (reportBody.ItemPageSizes.Width < m_itemPageSizes.Width)
             {
                 reportBody.ItemPageSizes.Width = m_itemPageSizes.Width;
             }
         }
     }
 }
Exemple #4
0
 private static List <Declaration> BuildDeclarations()
 {
     return(new List <Declaration>(30)
     {
         PageItem.GetDeclaration(),
         PageItemContainer.GetDeclaration(),
         ItemSizes.GetDeclaration(),
         HiddenPageItem.GetDeclaration(),
         NoRowsItem.GetDeclaration(),
         SubReport.GetDeclaration(),
         ReportBody.GetDeclaration(),
         Rectangle.GetDeclaration(),
         TextBox.GetDeclaration(),
         TextBox.TextBoxOffset.GetDeclaration(),
         Paragraph.GetDeclaration(),
         TextRun.GetDeclaration(),
         Line.GetDeclaration(),
         DynamicImage.GetDeclaration(),
         Chart.GetDeclaration(),
         GaugePanel.GetDeclaration(),
         Image.GetDeclaration(),
         Tablix.GetDeclaration(),
         Tablix.RowInfo.GetDeclaration(),
         Tablix.SizeInfo.GetDeclaration(),
         Tablix.ColumnInfo.GetDeclaration(),
         Tablix.PageTalixCell.GetDeclaration(),
         Tablix.PageDetailCell.GetDeclaration(),
         Tablix.PageCornerCell.GetDeclaration(),
         Tablix.PageMemberCell.GetDeclaration(),
         Tablix.PageStructMemberCell.GetDeclaration(),
         Tablix.PageStructStaticMemberCell.GetDeclaration(),
         Tablix.PageStructDynamicMemberCell.GetDeclaration(),
         Map.GetDeclaration(),
         PageBreakProperties.GetDeclaration()
     });
 }
Exemple #5
0
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.ItemSizes:
                persistObj = new ItemSizes();
                break;

            case ObjectType.PageBreakProperties:
                persistObj = new PageBreakProperties();
                break;

            case ObjectType.HiddenPageItem:
                persistObj = new HiddenPageItem();
                break;

            case ObjectType.NoRowsItem:
                persistObj = new NoRowsItem();
                break;

            case ObjectType.SubReport:
                persistObj = new SubReport();
                break;

            case ObjectType.ReportBody:
                persistObj = new ReportBody();
                break;

            case ObjectType.Rectangle:
                persistObj = new Rectangle();
                break;

            case ObjectType.TextBox:
                persistObj = new TextBox();
                break;

            case ObjectType.Paragraph:
                persistObj = new Paragraph();
                break;

            case ObjectType.TextRun:
                persistObj = new TextRun();
                break;

            case ObjectType.TextBoxOffset:
                persistObj = new TextBox.TextBoxOffset();
                break;

            case ObjectType.Line:
                persistObj = new Line();
                break;

            case ObjectType.Chart:
                persistObj = new Chart();
                break;

            case ObjectType.GaugePanel:
                persistObj = new GaugePanel();
                break;

            case ObjectType.Map:
                persistObj = new Map();
                break;

            case ObjectType.Image:
                persistObj = new Image();
                break;

            case ObjectType.Tablix:
                persistObj = new Tablix();
                break;

            case ObjectType.RowInfo:
                persistObj = new Tablix.RowInfo();
                break;

            case ObjectType.SizeInfo:
                persistObj = new Tablix.SizeInfo();
                break;

            case ObjectType.ColumnInfo:
                persistObj = new Tablix.ColumnInfo();
                break;

            case ObjectType.PageDetailCell:
                persistObj = new Tablix.PageDetailCell();
                break;

            case ObjectType.PageCornerCell:
                persistObj = new Tablix.PageCornerCell();
                break;

            case ObjectType.PageMemberCell:
                persistObj = new Tablix.PageMemberCell();
                break;

            case ObjectType.PageStructStaticMemberCell:
                persistObj = new Tablix.PageStructStaticMemberCell();
                break;

            case ObjectType.PageStructDynamicMemberCell:
                persistObj = new Tablix.PageStructDynamicMemberCell();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
        internal double NextPage(RPLWriter rplWriter, int pageNumber, int totalPages, double top, double availableHeight, ReportSection nextSection, bool isFirstSectionOnPage)
        {
            double num  = 0.0;
            bool   flag = nextSection == null;

            if (!flag)
            {
                SectionPaginationSettings sectionPaginationSettings = nextSection.SectionPaginationSettings;
                num = 2.5399999618530273 + sectionPaginationSettings.FooterHeight;
                PageSection pageHeader = nextSection.ROMReportSection.Page.PageHeader;
                if (pageHeader != null && pageHeader.PrintBetweenSections)
                {
                    num += sectionPaginationSettings.HeaderHeight;
                }
            }
            double      num2        = 0.0;
            PageSection pageHeader2 = m_reportSection.Page.PageHeader;
            PageSection pageFooter  = m_reportSection.Page.PageFooter;
            bool        flag2       = pageHeader2?.PrintBetweenSections ?? false;
            bool        flag3       = pageFooter?.PrintBetweenSections ?? false;

            m_needsHeaderHeight = (isFirstSectionOnPage ? (pageHeader2 != null) : flag2);
            if (m_needsHeaderHeight)
            {
                num2            += m_sectionPageSettings.HeaderHeight;
                availableHeight -= num2;
            }
            if (pageFooter != null)
            {
                availableHeight -= m_sectionPageSettings.FooterHeight;
            }
            bool flag4 = false;
            bool flag5 = false;

            m_reportSection.SetPage(m_pageContext.PageNumberRegion, m_pageContext.Common.GetTotalPagesRegion(pageNumber), pageNumber, totalPages);
            bool needsReportItemsOnPage = m_reportSection.NeedsReportItemsOnPage;
            bool flag6 = m_pageContext.PropertyCacheState != PageContext.CacheState.CountPages;

            m_pageContext.EvaluatePageHeaderFooter = false;
            if (needsReportItemsOnPage && flag6)
            {
                if ((flag2 && !isFirstSectionOnPage) || HasHeaderOnPage(pageNumber, totalPages))
                {
                    flag4 = true;
                }
                if (HasFooterOnPage(pageNumber, totalPages) || (flag3 && !flag))
                {
                    flag5 = true;
                }
                if (flag4 || flag5)
                {
                    m_pageContext.EvaluatePageHeaderFooter = true;
                }
            }
            if (rplWriter != null)
            {
                m_columns = new List <ColumnDetail>(m_sectionPageSettings.Columns);
                WriteStartItemToStream(rplWriter);
            }
            long num3 = 0L;

            if (!Done)
            {
                double columnWidth = m_sectionPageSettings.ColumnWidth;
                m_pageContext.Common.Pagination.CurrentColumnWidth = columnWidth;
                m_columnHeight = availableHeight;
                m_pageContext.Common.Pagination.CurrentColumnHeight = m_columnHeight;
                int           num4           = 0;
                int           columns        = m_sectionPageSettings.Columns;
                RoundedDouble roundedDouble  = new RoundedDouble(m_topEdge);
                RoundedDouble roundedDouble2 = new RoundedDouble(m_leftEdge);
                m_pageContext.VerticalPageNumber = m_verticalPageNumber;
                while (num4 < columns)
                {
                    bool anyAncestorHasKT = false;
                    if (m_leftEdge == 0.0)
                    {
                        if (m_pageContext.TextBoxDuplicates != null)
                        {
                            m_pageContext.TextBoxDuplicates = null;
                            m_reportBody.ResolveDuplicates(m_pageContext, m_topEdge, null, recalculate: false);
                        }
                        m_reportBody.CalculateVertical(m_pageContext, m_topEdge, m_topEdge + availableHeight, null, new List <PageItem>(), ref anyAncestorHasKT, hasUnpinnedAncestors: false);
                        m_verticalPageNumber++;
                        m_pageContext.VerticalPageNumber = m_verticalPageNumber;
                    }
                    anyAncestorHasKT = false;
                    m_reportBody.CalculateHorizontal(m_pageContext, m_leftEdge, m_leftEdge + columnWidth, null, new List <PageItem>(), ref anyAncestorHasKT, hasUnpinnedAncestors: false);
                    num3 = m_pageContext.PropertyCacheWriter.BaseStream.Position;
                    m_reportBody.AddToPage(rplWriter, m_pageContext, m_leftEdge, m_topEdge, m_leftEdge + columnWidth, m_topEdge + availableHeight, PageItem.RepeatState.None);
                    rplWriter?.RegisterSectionItemizedData();
                    m_pageContext.PropertyCacheWriter.BaseStream.Seek(num3, SeekOrigin.Begin);
                    if (rplWriter != null)
                    {
                        m_columns.Add(new ColumnDetail(0.0 - m_leftEdge, 0.0 - m_topEdge, m_reportBody));
                    }
                    m_leftEdge          += columnWidth;
                    roundedDouble2.Value = m_leftEdge;
                    if (num4 == 0 && m_reportBody.ItemPageSizes.Bottom - m_topEdge < availableHeight)
                    {
                        m_columnHeight = m_reportBody.ItemPageSizes.Bottom - m_topEdge;
                    }
                    if (roundedDouble2 >= m_reportBody.ItemPageSizes.Width)
                    {
                        m_leftEdge          = 0.0;
                        m_topEdge          += availableHeight;
                        roundedDouble.Value = m_topEdge;
                        m_reportBody.ResetHorizontal(spanPages: true, null);
                        m_pageContext.Common.PaginatingHorizontally = false;
                    }
                    else
                    {
                        m_pageContext.Common.PaginatingHorizontally = true;
                    }
                    num4++;
                    if (roundedDouble >= m_reportBody.ItemPageSizes.Bottom)
                    {
                        m_reportBody = null;
                        m_topEdge    = 0.0;
                        m_leftEdge   = 0.0;
                        break;
                    }
                }
            }
            double num5 = availableHeight - m_columnHeight;

            if (Done && !flag && pageFooter != null && !flag3)
            {
                num5 += m_sectionPageSettings.FooterHeight;
            }
            bool flag7 = false;

            if (num5 < num || flag)
            {
                m_columnHeight = availableHeight;
                flag7          = true;
                num2          += m_sectionPageSettings.FooterHeight;
            }
            else if (flag3)
            {
                num2 += m_sectionPageSettings.FooterHeight;
            }
            m_itemPageSizes.Height = num2 + m_columnHeight;
            m_itemPageSizes.Top    = top;
            WriteColumns(rplWriter);
            m_columns = null;
            if (Done && flag && totalPages == 0)
            {
                totalPages = pageNumber;
            }
            if (flag6)
            {
                flag4 = ((!isFirstSectionOnPage) ? flag2 : HasHeaderOnPage(pageNumber, totalPages));
                flag5 = ((!flag7) ? flag3 : HasFooterOnPage(pageNumber, totalPages));
            }
            if (flag4 || flag5)
            {
                m_pageContext.Common.CheckPageNameChanged();
                m_reportSection.SetPageName(m_pageContext.PageName);
                m_reportSection.GetPageSections();
                if (flag4 && !IsHeaderUnknown(isFirstSectionOnPage, pageNumber, totalPages))
                {
                    RenderHeader(rplWriter);
                }
                else
                {
                    m_header = null;
                    flag4    = false;
                }
                if (flag5)
                {
                    RenderFooter(rplWriter);
                }
                else
                {
                    m_footer = null;
                }
                if (rplWriter != null && (flag4 || flag5))
                {
                    rplWriter.RegisterSectionHeaderFooter();
                }
            }
            if (!IsHeaderUnknown(isFirstSectionOnPage, pageNumber, totalPages))
            {
                WriteEndItemToStream(rplWriter);
                m_wroteEndToStream = true;
            }
            else
            {
                m_wroteEndToStream = false;
            }
            rplWriter?.RegisterPageItemizedData();
            return(m_itemPageSizes.Height);
        }
 internal void SetContext()
 {
     m_reportBody = new ReportBody(m_reportSection.Body, m_reportSection.Width);
 }