示例#1
0
        protected void CreateGlobalHeaderRow(UReportPage page)
        {
            CRow r = (CRow)rowdef["GLB_HEADER_LEVEL0"];

            CRow   nr   = r.Clone();
            String info = String.Format("{0} ({1})", CUtil.DateTimeToDateStringTime(DateTime.Now), OnixWebServiceAPI.GetLastUserLogin());

            nr.FillColumnsText(info, "Page " + CurrentPage);
            ConstructUIRow(page, nr);

            AvailableSpace = AvailableSpace - nr.GetHeight();

            String rpid = rptparam.GetFieldValue("REPORT_ID");

            r = (CRow)rowdef["GLB_HEADER_LEVEL1"];
            r.FillColumnsText(reportObj.Optional);
            ConstructUIRow(page, r);

            AvailableSpace = AvailableSpace - r.GetHeight();

            String header = createReportParamHeader();

            if (!header.Equals(""))
            {
                CRow paramRow = (CRow)rowdef["GLB_HEADER_PARAM"];
                paramRow.FillColumnsText(header);
                ConstructUIRow(page, paramRow);

                AvailableSpace = AvailableSpace - paramRow.GetHeight();
            }
        }
示例#2
0
        protected void ConstructUIRows(UReportPage page, CReportDataProcessingProperty rpp)
        {
            ArrayList rows = rpp.ReportRows;

            foreach (CRow row in rows)
            {
                ConstructUIRow(page, row);
            }
        }
示例#3
0
        protected virtual UReportPage initNewArea(Size areaSize)
        {
            UReportPage page = new UReportPage();

            CreateGlobalHeaderRow(page);

            page.Width  = areaSize.Width;
            page.Height = areaSize.Height;
            page.Measure(areaSize);

            return(page);
        }
示例#4
0
        protected void ConstructUIRow(UReportPage page, CRow row)
        {
            double maxh = 0.00;
            Grid   grd  = new Grid();

            RowDefinition rd = new RowDefinition();

            rd.Height = new GridLength(row.GetHeight());
            grd.RowDefinitions.Add(rd);

            if (excel != null)
            {
                excel.AddRow(row);
            }

            int cnt = row.GetColumnCount();

            for (int i = 0; i < cnt; i++)
            {
                CColumn          clm = row.GetColumn(i);
                ColumnDefinition cd  = new ColumnDefinition();
                cd.Width = clm.GetWidth();
                grd.ColumnDefinitions.Add(cd);
            }

            for (int i = 0; i < cnt; i++)
            {
                CColumn clm = row.GetColumn(i);

                Border bd = new Border();

                bd.BorderBrush         = clm.GetBorderColor();
                bd.BorderThickness     = clm.GetBorderThickness();
                bd.VerticalAlignment   = VerticalAlignment.Stretch;
                bd.HorizontalAlignment = HorizontalAlignment.Stretch;

                TextBlock tblk = new TextBlock();

                tblk.Margin = row.GetMargin();
                tblk.HorizontalAlignment = clm.GetHorizontalAlignment();
                tblk.VerticalAlignment   = clm.GetVertocalAlignment();
                tblk.Text = clm.GetText().Text;
                //tblk.TextWrapping = TextWrapping.Wrap;
                if (row.GetFontFamily() != null)
                {
                    tblk.FontFamily = row.GetFontFamily();
                }
                tblk.FontWeight = row.GetFontWeight();
                tblk.FontStyle  = row.GetFontStyle();
                if (row.GetFontSize() > 0)
                {
                    tblk.FontSize = row.GetFontSize();
                }

                if (tblk.ActualHeight > maxh)
                {
                    maxh = tblk.ActualHeight;
                }

                bd.Child = tblk;

                Grid.SetColumn(bd, i);
                grd.Children.Add(bd);
            }

            page.AddRowPannel(grd);
        }
示例#5
0
        public virtual FixedDocument CreateReportFixedDocument()
        {
            excel = new CExcelRenderer(rptCfg.ReportName);
            FixedDocument fd = new FixedDocument();

            ReportProgressUpdate updateFunc = GetProgressUpdateFunc();
            ReportStatusUpdate   doneFunc   = GetProgressDoneFunc();

            fd.DocumentPaginator.PageSize = PageSize;

            if (doneFunc != null)
            {
                doneFunc(false, false);
            }

            ArrayList arr = getRecordSet();

            if (arr == null)
            {
                return(fd);
            }

            int         cnt  = arr.Count;
            UReportPage area = null;

            createRowTemplates();
            excel.CalculateMergeCellRange(baseTemplateName);

            int i = 0;
            int r = 0;

            Size areaSize = GetAreaSize();

            AvailableSpace = areaSize.Height;

            CReportDataProcessingProperty property = null;

            while (i < arr.Count)
            {
                CTable o = (CTable)arr[i];

                if ((r == 0) || (property.IsNewPageRequired))
                {
                    AvailableSpace = areaSize.Height;

                    CurrentPage++;

                    FixedPage fp = new FixedPage();
                    fp.Margin = Margin;

                    PageContent pageContent = new PageContent();
                    ((System.Windows.Markup.IAddChild)pageContent).AddChild(fp);

                    area = initNewArea(areaSize);
                    fp.Children.Add(area);

                    if (isInRange(CurrentPage))
                    {
                        fd.Pages.Add(pageContent);
                        pages.Add(area);
                    }
                }

                property = DataToProcessingProperty(o, arr, i);
                if (property.IsNewPageRequired)
                {
                    //Do not create row if that row caused new page flow
                    //But create it in the next page instead
                    i--;
                    r--;
                }
                else
                {
                    ConstructUIRows(area, property);
                }

                if (updateFunc != null)
                {
                    updateFunc(i, cnt);
                }

                i++;
                r++;
            }

            if (doneFunc != null)
            {
                doneFunc(true, false);
            }

            keepFixedDoc = fd;
            return(fd);
        }