Ejemplo n.º 1
0
        /// <summary>
        /// Creates a ReportTitleBand instance in the specified ReportPage.
        /// </summary>
        /// <param name="page">The ReportPage instance.</param>
        /// <returns>The ReportTitleBand instance.</returns>
        public static ReportTitleBand CreateReportTitleBand(ReportPage page)
        {
            ReportTitleBand reportTitle = new ReportTitleBand();

            page.ReportTitle = reportTitle;
            reportTitle.CreateUniqueName();
            return(reportTitle);
        }
Ejemplo n.º 2
0
        private void LoadReportHeaderBand() // Report Title
        {
            string name = FindReportOutsideBandName(REPORT_HEADER_BAND_MASK);

            if (!String.IsNullOrEmpty(name))
            {
                ReportTitleBand title       = ComponentsFactory.CreateReportTitleBand(page);
                string          description = GetObjectDescription(name);
                LoadBand(title, description);
                LoadObjects(description, title);
            }
        }
Ejemplo n.º 3
0
        private void LoadReportHeaderBandXml()
        {
            XmlNode node = FindBandNode("ReportHeaderBand");

            if (node == null)
            {
                return;
            }
            ReportTitleBand header = ComponentsFactory.CreateReportTitleBand(page);

            LoadBand(node, header);
            LoadObjects(node, header);
        }
Ejemplo n.º 4
0
        /// <inheritdoc/>
        public override void SetDefaults()
        {
            switch (Config.ReportSettings.DefaultPaperSize)
            {
            case DefaultPaperSize.A4:
                PaperWidth  = 210;
                PaperHeight = 297;
                break;

            case DefaultPaperSize.Letter:
                PaperWidth  = 215.9f;
                PaperHeight = 279.4f;
                break;
            }

            float baseHeight = Units.Millimeters * 10;

            if (ReportWorkspace.Grid.GridUnits == PageUnits.Inches ||
                ReportWorkspace.Grid.GridUnits == PageUnits.HundrethsOfInch)
            {
                baseHeight = Units.Inches * 0.4f;
            }

            ReportTitle = new ReportTitleBand();
            ReportTitle.CreateUniqueName();
            ReportTitle.Height = baseHeight;

            PageHeader = new PageHeaderBand();
            PageHeader.CreateUniqueName();
            PageHeader.Height = baseHeight * 0.75f;

            DataBand data = new DataBand();

            Bands.Add(data);
            data.CreateUniqueName();
            data.Height = baseHeight * 2;

            PageFooter = new PageFooterBand();
            PageFooter.CreateUniqueName();
            PageFooter.Height = baseHeight * 0.5f;
        }
Ejemplo n.º 5
0
        private Report CreateReport()
        {
            const int ROW_HIGHT = 20;
            Report    report    = new Report();

            ReportPage page = new ReportPage();

            page.Name = "FontList";
            report.Pages.Add(page);
            ReportTitleBand headerBand = new ReportTitleBand();

            headerBand.Name   = "Title";
            headerBand.Height = 40;
            page.ReportTitle  = headerBand;

            TextObject header = new FastReport.TextObject();

            header.Name   = "HeaderMemo";
            header.Width  = 300;
            header.Height = 30;
            header.Text   = "List of enumerated fonts";
            header.Font   = new Font(FontFamily.GenericSansSerif, 18);
            headerBand.Objects.Add(header);

            DataBand dataBand = new DataBand();

            dataBand.Name   = "DataBand";
            dataBand.Top    = 30;
            dataBand.Height = ROW_HIGHT;
            page.Bands.Add(dataBand);
            TextObject index = new FastReport.TextObject();

            index.Name   = "Index";
            index.Text   = "[Row#]";
            index.Height = ROW_HIGHT;
            index.Width  = 50;
            dataBand.Objects.Add(index);
            TextObject font_id = new FastReport.TextObject();

            font_id.Name   = "FontOD";
            font_id.Text   = "[FontList1.FontID]";
            font_id.Height = ROW_HIGHT;
            font_id.Width  = 300;
            font_id.Left   = 50;
            dataBand.Objects.Add(font_id);
            TextObject font_path = new FastReport.TextObject();

            font_path.Name   = "FilePath";
            font_path.Text   = "[FontList1.FontPath]";
            font_path.Left   = 350;
            font_path.Width  = 600;
            font_path.Height = ROW_HIGHT;
            dataBand.Objects.Add(font_path);

            report.RegisterData(fontList);
            FastReport.Data.DataSourceBase dsb = report.GetDataSource("FontList1");
            dsb.Enabled         = true;
            dataBand.DataSource = dsb;

            report.ReportInfo.Name = "font.list";

            if (WYSIWYG.Checked)
            {
                font_id.AfterData += Font_id_AfterData;
            }
            return(report);
        }