Exemplo n.º 1
0
        /// <summary>method write control to new row that will add to report body grid
        /// </summary>
        /// <param name="element">writing control</param>
        /// <returns>index of new row</returns>
        private int WriteElement(UIElement element)
        {
            m_CurrentReportPage.BodyGrid.RowDefinitions.Add(new RowDefinition());
            int rowIndex = m_CurrentReportPage.BodyGrid.RowDefinitions.Count - 1;

            XPSHelper.WriteItemToGrid(element, m_CurrentReportPage.BodyGrid, rowIndex, 0);
            m_CurrentReportPage.UpdatePageLayout();
            return(rowIndex);
        }
Exemplo n.º 2
0
        /// <summary>method return new grid spreaded to full report width with columns of same width
        /// </summary>
        /// <param name="rowCount">rows count</param>
        /// <param name="colCount">columns count</param>
        /// <param name="leftMargin">optional horizontal (left and right) margin</param>
        /// <returns>new grid</returns>
        public static Grid GetGridWithEqualColumns(int rowCount, int colCount, double leftMargin = 0, double topMargin = 0)
        {
            double        colWidth  = (ReportPage.ReportWidth * ReportPage.DisplayResolution - 2 * leftMargin) / (colCount * ReportPage.DisplayResolution);
            List <double> colWidths = new List <double>();

            for (int i = 0; i < colCount; i++)
            {
                colWidths.Add(colWidth);
            }
            Grid grid = XPSHelper.GetGrid(colWidths.ToArray(), rowCount);

            grid.Margin = new Thickness(leftMargin, topMargin, 0, 0);
            return(grid);
        }
Exemplo n.º 3
0
        /// <summary>default constructor
        /// </summary>
        /// <param name="header">page header object</param>
        /// <param name="footer">page footer object</param>
        public ReportPage(HeaderFooterBase header, HeaderFooterBase footer)
        {
            PageContent = new PageContent();
            FixedPage   = new FixedPage()
            {
                Background = Brushes.White, Width = m_DisplayResolution * m_PageWidth, Height = m_DisplayResolution * m_PageHeight
            };
            ((IAddChild)PageContent).AddChild(FixedPage);

            m_HeaderGrid = new Grid();
            m_FooterGrid = new Grid();
            BodyGrid     = XPSHelper.GetGrid(0, 1);

            header.Write(m_HeaderGrid);
            footer.Write(m_FooterGrid);

            WriteItemToPage(m_HeaderGrid, m_PageTopMargin, m_PageTopMargin);
            WriteItemToPage(BodyGrid, m_PageLeftMargin, m_HeaderGrid.ActualHeight / m_DisplayResolution + m_HeaderToBodyGap);
            WriteItemToPage(m_FooterGrid, m_PageLeftMargin, double.MinValue, double.MinValue, m_PageBottomMargin);
        }